Package com.db4o

Examples of com.db4o.ObjectContainer.queryByExample()


  public void toXML() {
    EmbeddedConfiguration config = Db4oEmbedded.newConfiguration();
    config.common().activationDepth(Integer.MAX_VALUE);
    ObjectContainer db4o = Db4oEmbedded.openFile(config, databaseFile);
    new XStreamFile(xstreamFile).write(db4o.queryByExample(null));
    db4o.close();
  }

  public void fromXML() {
    ObjectContainer db4o = Db4oEmbedded.openFile(databaseFile);
View Full Code Here


    }
    // DUMP DATABASE CONTENTS
    if(logDEBUG && database != null) {
    try {
    System.err.println("DUMPING DATABASE CONTENTS:");
    ObjectSet<Object> contents = database.queryByExample(new Object());
    Map<String,Integer> map = new HashMap<String, Integer>();
    for(Object o: contents) {
      String name = o.getClass().getName();
      if((map.get(name)) != null) {
        map.put(name, map.get(name)+1);
View Full Code Here

 

  private static void query() {
    ObjectContainer db = Db4o.openFile(DBFILENAME);
    try {
      ObjectSet set = db.queryByExample(TestDummy.class);
      if (ITERATIONS != set.size()) {
        System.err.println("Expected: " + ITERATIONS + ", actual: " + set.size());
      }
    } finally {
      db.close();
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.