Package com.db4o.query

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


  @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;
  }

  public static final Feed loadFeed(ObjectContainer db, URI link, Integer activationDepth) {
    try {
View Full Code Here


  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)) {
        fDb.delete(feed);
      }
    }
View Full Code Here

    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();

    if (marks.size() == 1) {
      return true;
    }
    return false;
View Full Code Here

  @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) {
    try {
View Full Code Here

    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

  @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

      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);
        return entity;
      }
    } catch (Db4oException e) {
View Full Code Here

      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
        // with this.
        fDb.activate(entity, Integer.MAX_VALUE);
        return entity;
View Full Code Here

  @SuppressWarnings("unchecked")
  private ISearchMark getSearchMark(ISearchCondition searchCondition) {
    Query query = fDb.query();
    query.constrain(ISearchMark.class);
    query.descend("fSearchConditions").constrain(searchCondition);
    List<ISearchMark> marks = query.execute();
    if (marks.size() != 1)
      throw new IllegalStateException("searchCondition has less than or more than 1 parent ISearchMark");

    return marks.get(0);
  }
View Full Code Here

    //TODO Share logic with IApplicationLayer method that does the same
    Query query = fDb.query();
    query.constrain(Feed.class);
    query.descend("fLinkText").constrain(mark.getFeedLinkReference().getLink().toString()); //$NON-NLS-1$
    @SuppressWarnings("unchecked")
    List<IFeed> feeds = query.execute();
    for (IFeed feed : feeds) {
      if(onlyBookMarkReference(feed)) {
        fDb.delete(feed);
      }
    }
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.