Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard

Diff Revisions 3db092 ... vs 8012b0 ... for ruralHouses/src/dataAccess/DB4oManager.java

Diff revisions: vs.
  @@ -35,9 +35,9 @@
35 35 private static ObjectContainer db;
36 36 private static EmbeddedConfiguration configuration;
37 37 private static ClientConfiguration configurationCS;
38 - private int bookingNumber = 0; // if it is "static" then it is not
38 + private int bookingNumber = 1; // if it is "static" then it is not
39 39 // serialized
40 - private int offerNumber = 0; // if it is "static" then it is not serialized
40 + private int offerNumber = 1; // if it is "static" then it is not serialized
41 41 private static DB4oManager theDB4oManager = null;
42 42
43 43 private static DB4oManagerAux theDB4oManagerAux;
  @@ -45,7 +45,7 @@
45 45 static ConfigXML c;
46 46
47 47 private DB4oManager() throws Exception {
48 - theDB4oManagerAux = new DB4oManagerAux(0, 0);
48 + theDB4oManagerAux = new DB4oManagerAux(1, 1);
49 49 c = ConfigXML.getInstance();
50 50 System.out.println("Creating DB4oManager instance => isDatabaseLocal: "
51 51 + c.isDatabaseLocal() + " getDatabBaseOpenMode: "
  @@ -620,8 +620,10 @@
620 620 .getOffer().getOfferNumber(), new RuralHouse(b.getOffer()
621 621 .getRuralHouse().getHouseName(), null, null, null, null),
622 622 null, null, 0), b.getClient(), b.getBookDate());
623 - book.setOffer(null);
624 - db.delete(book);
623 + Booking delete = (Booking) db.queryByExample(book).get(0);
624 + delete.setOffer(null);
625 + db.store(delete);
626 + db.delete(delete);
625 627 db.commit();
626 628 } catch (Exception e) {
627 629 e.printStackTrace();