debugging
authorpinene <epinzolas001@ikasle.ehu.es>
Sun, 19 Apr 2015 19:24:55 +0000 (21:24 +0200)
committerpinene <epinzolas001@ikasle.ehu.es>
Sun, 19 Apr 2015 19:24:55 +0000 (21:24 +0200)
ruralHouses/src/dataAccess/DB4oManager.java

index eb47769..03601e1 100644 (file)
@@ -462,6 +462,10 @@ public class DB4oManager {
                        ObjectSet<RuralHouse> result = db.queryByExample(house);
                        if (result.isEmpty()) {
                                Owner ow = (Owner) db.queryByExample(rh.getOwner()).get(0);
+                               ObjectSet<RuralHouse> orh = db.queryByExample(new RuralHouse(null, ow, null, null, null));
+                               for (RuralHouse aa: orh){
+                                       db.delete(aa);
+                               }
                                db.delete(ow);
                                ow.addRuralHouse(rh);
                                db.store(ow);