Package com.db4o

Examples of com.db4o.ObjectContainer.activate()


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

    List<NewsBin> newsBins = oc.query(NewsBin.class);

    for (INewsBin newsBin : newsBins) {
      oc.activate(newsBin, Integer.MAX_VALUE);
      for (NewsReference newsRef : newsBin.getNewsRefs()) {
        Query query = oc.query();
        query.constrain(News.class);
        query.descend("fId").constrain(newsRef.getId()); //$NON-NLS-1$
        News news = (News) query.execute().iterator().next();
View Full Code Here


      for (NewsReference newsRef : newsBin.getNewsRefs()) {
        Query query = oc.query();
        query.constrain(News.class);
        query.descend("fId").constrain(newsRef.getId()); //$NON-NLS-1$
        News news = (News) query.execute().iterator().next();
        oc.activate(news, Integer.MAX_VALUE);
        String parentIdFieldName = "fParentId"; //$NON-NLS-1$
        MigrationHelper.setField(news, parentIdFieldName, newsBin.getId().longValue());
        oc.ext().set(news, Integer.MAX_VALUE);
      }
    }
View Full Code Here

      /* Assert NewsCounter / NewsCounterItem */
      NewsCounter newsCounter = db.query(NewsCounter.class).get(0);
      db.activate(newsCounter, Integer.MAX_VALUE);
      NewsCounter otherNewsCounter = defragmentedDb.query(NewsCounter.class).get(0);
      defragmentedDb.activate(otherNewsCounter, Integer.MAX_VALUE);
      assertNotNull(newsCounter);
      assertNotNull(otherNewsCounter);

      NewsCounterItem item = otherNewsCounter.get("http://www.rssowl.org");
      assertEquals(1, item.getNewCounter());
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.