Examples of constrain()


Examples of com.db4o.query.Query.constrain()

    return null;
  }

  public IPreference load(String key) throws PersistenceException {
    Query query = fDb.query();
    query.constrain(fEntityClass);
    query.descend("fKey").constrain(key);
    List<IPreference> prefs = getList(query);
    activateAll(prefs);
    if (!prefs.isEmpty()) {
      return prefs.iterator().next();
View Full Code Here

Examples of com.db4o.query.Query.constrain()

  }

  @SuppressWarnings("unchecked")
  private static List<Feed> getFeeds(ObjectContainer db, URI link){
    Query query = db.query();
    query.constrain(Feed.class);
    query.descend("fLinkText").constrain(link.toString()); //$NON-NLS-1$
    List<Feed> set = query.execute();
    return set;
  }
View Full Code Here

Examples of com.db4o.query.Query.constrain()

  }

  public final Collection<IBookMark> loadAll(FeedLinkReference feedRef) {
    try {
      Query query = fDb.query();
      query.constrain(fEntityClass);
      query.descend("fFeedLink").constrain(feedRef.getLink().toString()); //$NON-NLS-1$
      List<IBookMark> marks = getList(query);
      activateAll(marks);
      return new ArrayList<IBookMark>(marks);
    } catch (Db4oException e) {
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    return entities.contains(entity);
  }

  private void deleteFeedIfNecessary(IBookMark mark) {
    Query query = fDb.query();
    query.constrain(Feed.class);
    query.descend("fId").constrain(mark.getFeedReference().getId()); //$NON-NLS-1$
    @SuppressWarnings("unchecked")
    ObjectSet<IFeed> feeds = query.execute();
    for (IFeed feed : feeds) {
      if(onlyBookMarkReference(feed)) {
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    }
  }

  private boolean onlyBookMarkReference(IFeed feed) {
    Query query = fDb.query();
    query.constrain(BookMark.class);
    query.descend("fFeedId").constrain(feed.getId().longValue()); //$NON-NLS-1$
   
    @SuppressWarnings("unchecked")
    ObjectSet<IBookMark> marks = query.execute();
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    }
  }

  private List<T> loadList(long id) throws Db4oException   {
    Query query = fDb.query();
    query.constrain(fEntityClass);
    query.descend("fId").constrain(Long.valueOf(id)); //$NON-NLS-1$
    return getList(query);
  }

  @Override
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    /* 80 */
    progressMonitor.worked(40);

    for (Map.Entry<Long, Map<String, ?>> entry : idPropertiesMap.entrySet()) {
      Query query = oc.query();
      query.constrain(org.rssowl.core.internal.persist.AbstractEntity.class);
      query.descend("fId").constrain(entry.getKey()); //$NON-NLS-1$
      List<?> list = query.execute();
      org.rssowl.core.internal.persist.AbstractEntity entity = (org.rssowl.core.internal.persist.AbstractEntity) list.get(0);
      oc.activate(entity, Integer.MAX_VALUE);
      for (Map.Entry<String, ?> valueEntry : entry.getValue().entrySet()) {
View Full Code Here

Examples of com.db4o.query.Query.constrain()

  }
 
  @SuppressWarnings("unchecked")
  private Preference findPreference(String key)   {
    Query query = fDb.ext().query();
    query.constrain(Preference.class);
    query.descend("fKey").constrain(key); //$NON-NLS-1$
    ObjectSet<Preference> prefs = query.execute();
    if (prefs.hasNext()) {
      Preference pref = prefs.next();
      fDb.activate(pref, Integer.MAX_VALUE);
View Full Code Here

Examples of com.db4o.query.Query.constrain()

        + dbNews.toLongString());
  }

  private List<INews> getNewsFromGuid(INews newsItem) {
    Query query = fDb.query();
    query.constrain(fEntityClass);
    query.descend("fGuidValue").constrain(newsItem.getGuid().getValue()); //$NON-NLS-1$
    return activateAll(getList(query));
  }

  private List<INews> getNewsFromLink(INews newsItem) {
View Full Code Here

Examples of com.db4o.query.Query.constrain()

    return activateAll(getList(query));
  }

  private List<INews> getNewsFromLink(INews newsItem) {
    Query query = fDb.query();
    query.constrain(fEntityClass);
    query.descend("fLinkText").constrain(newsItem.getLink().toString()); //$NON-NLS-1$
    return activateAll(getList(query));
  }

  private Set<INews> setState(Collection<INews> news, State state, boolean force) {
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.