Fixed persisting of estates
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -154,15 +154,16 @@ public class Main {
|
|||||||
apartment.setBalcony(input.equals("Y") || input.equals("y"));
|
apartment.setBalcony(input.equals("Y") || input.equals("y"));
|
||||||
input = FormUtil.readString("Built-in Kitchen(Y/N)");
|
input = FormUtil.readString("Built-in Kitchen(Y/N)");
|
||||||
apartment.setBuiltinKitchen(input.equals("Y") || input.equals("y"));
|
apartment.setBuiltinKitchen(input.equals("Y") || input.equals("y"));
|
||||||
|
_orm.persist(apartment);
|
||||||
} else {
|
} else {
|
||||||
House house = new House(estate);
|
House house = new House(estate);
|
||||||
house.setPrice(FormUtil.readInt("Price"));
|
house.setPrice(FormUtil.readInt("Price"));
|
||||||
house.setFloors(FormUtil.readInt("Floors"));
|
house.setFloors(FormUtil.readInt("Floors"));
|
||||||
input = FormUtil.readString("Garden(Y/N)");
|
input = FormUtil.readString("Garden(Y/N)");
|
||||||
house.setGarden(input.equals("Y") || input.equals("y"));
|
house.setGarden(input.equals("Y") || input.equals("y"));
|
||||||
|
_orm.persist(house);
|
||||||
}
|
}
|
||||||
|
|
||||||
_orm.persist(estate);
|
|
||||||
System.out.println("Estate with the ID " + estate.getId() + " was created.");
|
System.out.println("Estate with the ID " + estate.getId() + " was created.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user