Examples of Pilot


Examples of org.springmodules.db4o.examples.Pilot

* @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

Examples of org.springmodules.db4o.examples.Pilot

    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

Examples of org.springmodules.db4o.examples.Pilot

    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

Examples of org.springmodules.db4o.examples.Pilot

    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

Examples of org.springmodules.db4o.examples.Pilot

      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

Examples of org.springmodules.db4o.examples.Pilot

    ObjectSet result = db.get(proto);
    listResult(result);
  }

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

Examples of org.springmodules.db4o.examples.Pilot

    ObjectSet result = db.get(proto);
    listResult(result);
  }

  public static void updatePilot(ObjectContainer db) {
    ObjectSet result = db.get(new Pilot("Michael Schumacher", 0));
    Pilot found = (Pilot) result.next();
    found.addPoints(11);
    db.set(found);
    System.out.println("Added 11 points for " + found);
    retrieveAllPilots(db);
  }
View Full Code Here

Examples of org.springmodules.db4o.examples.Pilot

    System.out.println("Added 11 points for " + found);
    retrieveAllPilots(db);
  }

  public static void deleteFirstPilotByName(ObjectContainer db) {
    ObjectSet result = db.get(new Pilot("Michael Schumacher", 0));
    Pilot found = (Pilot) result.next();
    db.delete(found);
    System.out.println("Deleted " + found);
    retrieveAllPilots(db);
  }
View Full Code Here

Examples of org.springmodules.db4o.examples.Pilot

    System.out.println("Deleted " + found);
    retrieveAllPilots(db);
  }

  public static void deleteSecondPilotByName(ObjectContainer db) {
    ObjectSet result = db.get(new Pilot("Rubens Barrichello", 0));
    Pilot found = (Pilot) result.next();
    db.delete(found);
    System.out.println("Deleted " + found);
    retrieveAllPilots(db);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.