Skip to content
Snippets Groups Projects
Commit f0751fa6 authored by Petr Adamek's avatar Petr Adamek
Browse files

Refactoring: getFullCategoryFromDb renamed to toEntity

parent 9c9fb1db
No related branches found
No related tags found
2 merge requests!52Final project MR,!51M02review
......@@ -65,7 +65,7 @@ public class CategoryDao implements DataAccessObject<Category> {
try (var rs = st.executeQuery()) {
while (rs.next()) {
categories.add(getFullCategoryFromDb(rs));
categories.add(toEntity(rs));
}
}
......@@ -135,7 +135,7 @@ public class CategoryDao implements DataAccessObject<Category> {
try (var rs = st.executeQuery()) {
if (rs.next()) {
var task = getFullCategoryFromDb(rs);
var task = toEntity(rs);
if (rs.next()) {
throw new DataAccessException("Multiple categories with id " + id + " found");
......@@ -150,7 +150,7 @@ public class CategoryDao implements DataAccessObject<Category> {
}
}
private Category getFullCategoryFromDb(ResultSet rs) throws SQLException {
private Category toEntity(ResultSet rs) throws SQLException {
var id = rs.getLong("ID");
var category = new Category(
rs.getString("TITLE"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment