Package org.springmodules.db4o.examples

Examples of org.springmodules.db4o.examples.Pilot


*
*/
public class QueryExample {
  private static void listResult(ObjectSet result) {
    for (Iterator it = result.iterator(); it.hasNext();) {
      Pilot pilot = (Pilot) it.next();
      System.out.println(pilot.toString());
    }
  }
View Full Code Here


      System.out.println(pilot.toString());
    }
  }

  public static void storeFirstPilot(ObjectContainer db) {
    Pilot pilot1 = new Pilot("Michael Schumacher", 100);
    db.set(pilot1);
    System.out.println("Stored " + pilot1);
  }
View Full Code Here

    db.set(pilot1);
    System.out.println("Stored " + pilot1);
  }

  public static void storeSecondPilot(ObjectContainer db) {
    Pilot pilot2 = new Pilot("Rubens Barrichello", 99);
    db.set(pilot2);
    System.out.println("Stored " + pilot2);
  }
View Full Code Here

    ObjectSet result = query.execute();
    listResult(result);
  }

  public static void retrieveByDefaultFieldValue(ObjectContainer db) {
    Pilot somebody = new Pilot("Somebody else", 0);
    db.set(somebody);
    Query query = db.query();
    query.constrain(Pilot.class);
    query.descend("points").constrain(new Integer(0));
    ObjectSet result = query.execute();
View Full Code Here

    result = query.execute();
    listResult(result);
  }

  public static void clearDatabase(ObjectContainer db) {
    ObjectSet result = db.get(new Pilot(null, 0));
    while (result.hasNext()) {
      db.delete(result.next());
    }
  }
View Full Code Here

* @author Daniel Mitterdorfer.
*
*/
public class FirstStepsExample {
  public static void storeFirstPilot(ObjectContainer db) {
    Pilot pilot1 = new Pilot("Michael Schumacher", 100);
    db.set(pilot1);
    System.out.println("Stored " + pilot1);
  }
View Full Code Here

    db.set(pilot1);
    System.out.println("Stored " + pilot1);
  }

  public static void storeSecondPilot(ObjectContainer db) {
    Pilot pilot2 = new Pilot("Rubens Barrichello", 99);
    db.set(pilot2);
    System.out.println("Stored " + pilot2);
  }
View Full Code Here

    db.set(pilot2);
    System.out.println("Stored " + pilot2);
  }

  public static void retrieveAllPilots(ObjectContainer db) {
    Pilot proto = new Pilot(null, 0);
    ObjectSet result = db.get(proto);
    listResult(result);
  }
View Full Code Here

    listResult(result);
  }

  public static void listResult(ObjectSet result) {
    for (Iterator it = result.iterator(); it.hasNext();) {
      Pilot pilot = (Pilot) it.next();
      System.out.println(pilot.toString());
    }
  }
View Full Code Here

      System.out.println(pilot.toString());
    }
  }

  public static void retrievePilotByName(ObjectContainer db) {
    Pilot proto = new Pilot("Michael Schumacher", 0);
    ObjectSet result = db.get(proto);
    listResult(result);
  }
View Full Code Here

TOP

Related Classes of org.springmodules.db4o.examples.Pilot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.