Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard

Diff Revisions ba6020 ... vs 520867 ... for ruralHouses/src/dataAccess/DB4oManager.java

Diff revisions: vs.
  @@ -4,15 +4,12 @@
4 4 //import java.util.Enumeration;
5 5 //import java.util.Vector;
6 6 import java.rmi.RemoteException;
7 -
8 -
9 7 import java.util.Date;
10 8 import java.util.LinkedList;
11 9 import java.util.List;
12 10 import java.util.ListIterator;
13 11 import java.util.Vector;
14 12
15 -
16 13 import com.db4o.Db4oEmbedded;
17 14 import com.db4o.ObjectContainer;
18 15 import com.db4o.ObjectSet;
  @@ -72,8 +69,8 @@
72 69 } else // c.getDataBaseOpenMode().equals("open")
73 70
74 71 {
75 - ObjectSet res = db.queryByExample(DB4oManagerAux.class);
76 - ListIterator listIter = res.listIterator();
72 + ObjectSet<DB4oManagerAux> res = db.queryByExample(DB4oManagerAux.class);
73 + ListIterator<DB4oManagerAux> listIter = res.listIterator();
77 74 if (listIter.hasNext())
78 75 theDB4oManagerAux = (DB4oManagerAux) res.next();
79 76 }
  @@ -155,8 +152,7 @@
155 152
156 153 try {
157 154 Owner proto = new Owner(null, null);
158 - ObjectSet result = db.queryByExample(proto);
159 - Vector<Owner> owners = new Vector<Owner>();
155 + ObjectSet<Owner> result = db.queryByExample(proto);
160 156 while (result.hasNext()) {
161 157 Owner o = (Owner) result.next();
162 158 System.out.println("Deleted owner: " + o.toString());
  @@ -223,16 +219,23 @@
223 219 }
224 220
225 221
222 + @SuppressWarnings("static-access")
226 223 public LinkedList<RuralHouse>[] getAdminData(){
227 224 if (c.isDatabaseLocal() == false)
228 225 openSDB();
229 226 else
230 227 openDB();
228 + @SuppressWarnings("unchecked")
231 229 LinkedList<RuralHouse>[] ret = new LinkedList[2];
232 230
233 231 try {
234 232
235 233 List<Administrator> admL = db.query(new Predicate<Administrator>(){
234 + /**
235 + *
236 + */
237 + private static final long serialVersionUID = 1L;
238 +
236 239 public boolean match(Administrator admin){
237 240 return true;
238 241 }
  @@ -249,6 +252,7 @@
249 252
250 253 }
251 254
255 + @SuppressWarnings("static-access")
252 256 public void storeAdmin() {
253 257 if (c.isDatabaseLocal() == false)
254 258 openSDB();
  @@ -257,6 +261,11 @@
257 261 try {
258 262
259 263 List<Administrator> admL = db.query(new Predicate<Administrator>(){
264 + /**
265 + *
266 + */
267 + private static final long serialVersionUID = 1L;
268 +
260 269 public boolean match(Administrator admin){
261 270 return true;
262 271 }
  @@ -304,7 +313,7 @@
304 313
305 314 RuralHouse proto = new RuralHouse(ruralHouse.getHouseName(), null,
306 315 ruralHouse.getDescription(), ruralHouse.getDistrict(), null);
307 - ObjectSet result = db.queryByExample(proto);
316 + ObjectSet<RuralHouse> result = db.queryByExample(proto);
308 317 RuralHouse rh = (RuralHouse) result.next();
309 318
310 319 Offer offer;
  @@ -364,7 +373,7 @@
364 373
365 374 try {
366 375 RuralHouse proto = new RuralHouse(null, null, null, null, null);
367 - ObjectSet result = db.queryByExample(proto);
376 + ObjectSet<RuralHouse> result = db.queryByExample(proto);
368 377 Vector<RuralHouse> ruralHouses = new Vector<RuralHouse>();
369 378 while (result.hasNext())
370 379 ruralHouses.add((RuralHouse) result.next());