Examples of descend()


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

 
  @SuppressWarnings("unchecked")
  private static ObjectSet<IFeed> getFeedSet(ObjectContainer db, URL link){
    Query query = db.query();
    query.constrain(Feed.class);
    query.descend("fLinkText").constrain(link.toString()); //$NON-NLS-1$
    ObjectSet<IFeed> set = query.execute();
    return set;
  }

  static final IFeed loadFeed(ObjectContainer db, URL link, Integer activationDepth) {
View Full Code Here

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

    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()) {
        entity.setProperty(valueEntry.getKey(), valueEntry.getValue());
View Full Code Here

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

 
  @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);
      return pref;
View Full Code Here

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

  }

  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) {
    Query query = fDb.query();
View Full Code Here

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

  }

  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) {
    Set<INews> changedNews = new HashSet<INews>(news.size());
View Full Code Here

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

      return new ArrayList<INews>(0);

    try {
      Query query = fDb.query();
      query.constrain(News.class);
      query.descend("fFeedLink").constrain(feedRef.getLink().toString());
      if (!states.containsAll(EnumSet.allOf(INews.State.class))) {
        Constraint constraint = null;
        for (INews.State state : states) {
          if (constraint == null)
            constraint = query.descend("fStateOrdinal").constrain(state.ordinal());
View Full Code Here

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

      query.descend("fFeedLink").constrain(feedRef.getLink().toString());
      if (!states.containsAll(EnumSet.allOf(INews.State.class))) {
        Constraint constraint = null;
        for (INews.State state : states) {
          if (constraint == null)
            constraint = query.descend("fStateOrdinal").constrain(state.ordinal());
          else
            constraint = query.descend("fStateOrdinal").constrain(state.ordinal()).or(constraint);
        }
      }
View Full Code Here

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

        Constraint constraint = null;
        for (INews.State state : states) {
          if (constraint == null)
            constraint = query.descend("fStateOrdinal").constrain(state.ordinal());
          else
            constraint = query.descend("fStateOrdinal").constrain(state.ordinal()).or(constraint);
        }
      }

      Collection<INews> news = getList(query);
      activateAll(news);
View Full Code Here

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

  public final IConditionalGet loadConditionalGet(URL link) throws PersistenceException  {
    Assert.isNotNull(link, "link cannot be null"); //$NON-NLS-1$
    try {
      Query query = fDb.query();
      query.constrain(ConditionalGet.class);
      query.descend("fLink").constrain(link.toString()); //$NON-NLS-1$

      @SuppressWarnings("unchecked")
      ObjectSet<IConditionalGet> set = query.execute();
      for (IConditionalGet entity : set) {
        fDb.activate(entity, Integer.MAX_VALUE);
View Full Code Here

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

 
  private <T extends IEntity>T loadEntity(Class<T> klass, long id)  {
    try {
      Query query = fDb.query();
      query.constrain(klass);
      query.descend("fId").constrain(Long.valueOf(id)); //$NON-NLS-1$

      @SuppressWarnings("unchecked")
      ObjectSet<T> set = query.execute();
      for (T entity : set) {
        // TODO Activate completely by default for now. Must decide how to deal
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.