RRRRHHHH_Code
Diff Revisions
e3043c ...
vs
b09f34 ...
for ruralHouses/src/dataAccess/DB4oManager.java
|
@@ -328,12 +328,12 @@ |
328 |
328 |
|
openSDB(); |
329 |
329 |
|
|
330 |
330 |
|
RuralHouse proto = new RuralHouse(ruralHouse.getHouseName(), null, |
331 |
|
- |
ruralHouse.getDescription(), ruralHouse.getDistrict(), null); |
|
331 |
+ |
null, null, null); |
332 |
332 |
|
ObjectSet<RuralHouse> result = db.queryByExample(proto); |
333 |
333 |
|
RuralHouse rh = (RuralHouse) result.next(); |
334 |
334 |
|
|
335 |
335 |
|
Offer offer; |
336 |
|
- |
offer = rh.findOffer(firstDate, lastDate); |
|
336 |
+ |
offer = (Offer)db.queryByExample(new Offer(0, rh, firstDate, lastDate, 0)).get(0); |
337 |
337 |
|
|
338 |
338 |
|
if (offer != null) { |
339 |
339 |
|
offer.createBooking(theDB4oManagerAux.bookingNumber++, cl); |
|
@@ -380,22 +380,7 @@ |
380 |
380 |
|
} |
381 |
381 |
|
} |
382 |
382 |
|
|
383 |
|
- |
public Vector<RuralHouse> getAllRuralHouses() throws RemoteException, |
384 |
|
- |
Exception { |
385 |
383 |
|
|
386 |
|
- |
if (c.isDatabaseLocal() == false) |
387 |
|
- |
openSDB(); |
388 |
|
- |
else |
389 |
|
- |
openDB(); |
390 |
|
- |
|
391 |
|
- |
try { |
392 |
|
- |
RuralHouse proto = new RuralHouse(null, null, null, null, null); |
393 |
|
- |
ObjectSet<RuralHouse> result = db.queryByExample(proto); |
394 |
|
- |
return new Vector<RuralHouse>(result); |
395 |
|
- |
} finally { |
396 |
|
- |
db.close(); |
397 |
|
- |
} |
398 |
|
- |
} |
399 |
384 |
|
|
400 |
385 |
|
public boolean existsOverlappingOffer(RuralHouse rh, Date firstDay, |
401 |
386 |
|
Date lastDay) throws RemoteException, OverlappingOfferExists { |
|
@@ -419,10 +404,6 @@ |
419 |
404 |
|
} |
420 |
405 |
|
} |
421 |
406 |
|
|
422 |
|
- |
public static ObjectContainer getContainer() { |
423 |
|
- |
return db; |
424 |
|
- |
} |
425 |
|
- |
|
426 |
407 |
|
public void close() { |
427 |
408 |
|
db.close(); |
428 |
409 |
|
System.out.println("DataBase closed"); |
|
@@ -567,7 +548,7 @@ |
567 |
548 |
|
openDB(); |
568 |
549 |
|
|
569 |
550 |
|
try { |
570 |
|
- |
ObjectSet<Account> result = db.queryByExample(new Account(own)); |
|
551 |
+ |
ObjectSet<Account> result = db.queryByExample(new Account(null,null,own)); |
571 |
552 |
|
if (!result.isEmpty()) { |
572 |
553 |
|
db.delete(result.get(0)); |
573 |
554 |
|
db.commit(); |