优化代码。
This commit is contained in:
@@ -7,6 +7,7 @@ import java.sql.SQLException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -94,13 +95,12 @@ public class DictRepositoryImpl extends JdbcRepositorySupport<Dict, Long> implem
|
||||
|
||||
@Override
|
||||
protected final Dict mapRow(ResultSet rs) throws SQLException {
|
||||
long id = rs.getLong("id");
|
||||
return new Dict(
|
||||
id,
|
||||
rs.getString("dict_type"),
|
||||
rs.getString("dict_label"),
|
||||
this.dictValueDAO.selectDictValuesByDictId(id),
|
||||
rs.getLong("version"));
|
||||
final long id = rs.getLong("id");
|
||||
final String dictType = rs.getString("dict_type");
|
||||
final String dictLabel = rs.getString("dict_label");
|
||||
final Set<DictValue> values = this.dictValueDAO.selectDictValuesByDictId(id);
|
||||
final long version = rs.getLong("version");
|
||||
return new Dict(id, dictType, dictLabel, values, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user