Package com.db4o

Examples of com.db4o.ObjectContainer.ext()


   * TODO Provide a full copy mode (that includes IConditionalGet an NewsCounter)
   */
  @SuppressWarnings("unused")
  private void copyDatabase() {
      ObjectContainer db = Db4o.openFile(getDBFilePath() + "50");
      db.ext().configure().queries().evaluationMode(QueryEvaluationMode.IMMEDIATE);
      for (Folder type : fObjectContainer.query(Folder.class))  {
        fObjectContainer.activate(type, Integer.MAX_VALUE);
        if (type.getParent() == null) {
          db.ext().set(type, Integer.MAX_VALUE);
        }
View Full Code Here


      ObjectContainer db = Db4o.openFile(getDBFilePath() + "50");
      db.ext().configure().queries().evaluationMode(QueryEvaluationMode.IMMEDIATE);
      for (Folder type : fObjectContainer.query(Folder.class))  {
        fObjectContainer.activate(type, Integer.MAX_VALUE);
        if (type.getParent() == null) {
          db.ext().set(type, Integer.MAX_VALUE);
        }
      }
      for (Feed feed : fObjectContainer.query(Feed.class)) {
        fObjectContainer.activate(feed, Integer.MAX_VALUE);
        db.ext().set(feed, Integer.MAX_VALUE);
View Full Code Here

          db.ext().set(type, Integer.MAX_VALUE);
        }
      }
      for (Feed feed : fObjectContainer.query(Feed.class)) {
        fObjectContainer.activate(feed, Integer.MAX_VALUE);
        db.ext().set(feed, Integer.MAX_VALUE);
      }
      for (Preference pref : fObjectContainer.query(Preference.class)) {
        fObjectContainer.activate(pref, Integer.MAX_VALUE);
        db.ext().set(pref, Integer.MAX_VALUE);
      }
View Full Code Here

        fObjectContainer.activate(feed, Integer.MAX_VALUE);
        db.ext().set(feed, Integer.MAX_VALUE);
      }
      for (Preference pref : fObjectContainer.query(Preference.class)) {
        fObjectContainer.activate(pref, Integer.MAX_VALUE);
        db.ext().set(pref, Integer.MAX_VALUE);
      }
      List<Counter> counterSet = fObjectContainer.query(Counter.class);
      Counter counter = counterSet.iterator().next();
      fObjectContainer.activate(counter, Integer.MAX_VALUE);
      db.ext().set(counter, Integer.MAX_VALUE);
View Full Code Here

        db.ext().set(pref, Integer.MAX_VALUE);
      }
      List<Counter> counterSet = fObjectContainer.query(Counter.class);
      Counter counter = counterSet.iterator().next();
      fObjectContainer.activate(counter, Integer.MAX_VALUE);
      db.ext().set(counter, Integer.MAX_VALUE);

      db.commit();
  }

  private Configuration createConfiguration() {
View Full Code Here

    oc = Db4o.openFile(configFactory.createConfiguration(), dbFileName);

    /* Preference */
    for (Preference pref : oc.query(Preference.class)) {
      oc.activate(pref, Integer.MAX_VALUE);
      oc.ext().set(convertPref(pref), Integer.MAX_VALUE);
      oc.delete(pref);
    }
    oc.commit();
    /* 20 */
    progressMonitor.worked(10);
View Full Code Here

    for (org.rssowl.core.persist.ISearchField searchField : oc.query(org.rssowl.core.internal.persist.SearchField.class))   {
      oc.activate(searchField, Integer.MAX_VALUE);
      String entityName = searchField.getEntityName();
      entityName = entityName.replace("core.model.types", "core.persist");
      MigrationHelper.setField(searchField, "fEntityName", entityName);
      oc.ext().set(searchField, Integer.MAX_VALUE);
    }
    oc.commit();
    /* 30 */
    progressMonitor.worked(10);

View Full Code Here

    for (org.rssowl.core.persist.ISearchCondition searchCond : oc.query(org.rssowl.core.internal.persist.SearchCondition.class))   {
      oc.activate(searchCond, Integer.MAX_VALUE);
      int searchSpecOrdinal = searchCond.getSpecifier().ordinal();
      org.rssowl.core.persist.SearchSpecifier searchSpec = org.rssowl.core.persist.SearchSpecifier.values()[searchSpecOrdinal];
      MigrationHelper.setField(searchCond, "fSpecifier", searchSpec);
      oc.ext().set(searchCond, Integer.MAX_VALUE);
    }
    oc.commit();
    /* 40 */
    progressMonitor.worked(10);

View Full Code Here

      MigrationHelper.setField(folder, "fChildren", children);
      folders.add(folder);
    }
    /* Only save folders once they have all been updated */
    for (org.rssowl.core.persist.IFolder folder : folders)   {
      oc.ext().set(folder, Integer.MAX_VALUE);
    }

    List<org.rssowl.core.persist.IMark> marks = new ArrayList<org.rssowl.core.persist.IMark>();
    for (org.rssowl.core.persist.IMark mark : oc.query(org.rssowl.core.internal.persist.Mark.class))   {
      oc.activate(mark, Integer.MAX_VALUE);
View Full Code Here

      marks.add(mark);
    }
    /* Only save folders once they have all been updated */
    for (org.rssowl.core.persist.IMark mark : marks)   {
      oc.ext().set(mark, Integer.MAX_VALUE);
    }

    oc.commit();
    /* 80 */
    progressMonitor.worked(40);
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.