Examples of descend()


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

  @SuppressWarnings("unchecked")
  public final List<IBookMark> loadBookMarks(IFeed feed) {
    try {
      Query query = fDb.query();
      query.constrain(IBookMark.class);
      query.descend("fFeedId").constrain(feed.getId()); //$NON-NLS-1$
      ObjectSet<IBookMark> marks = query.execute();
      activateAll(marks);
      return new ArrayList<IBookMark>(marks);
    } catch (Db4oException e) {
      throw new PersistenceException(e);
View Full Code Here

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

  @SuppressWarnings("unchecked")
  public final List<IFolder> loadRootFolders() {
    try {
      Query query = fDb.query();
      query.constrain(IFolder.class);
      query.descend("fParent").constrain(null); //$NON-NLS-1$
      ObjectSet<IFolder> folders = query.execute();
      activateAll(folders);
      return new ArrayList<IFolder>(folders);
    } catch (Db4oException e) {
      throw new PersistenceException(e);
View Full Code Here

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

  @SuppressWarnings("unchecked")
  private List<INews> getNewsFromLink(INews newsItem) {
    Query query = fDb.query();
    query.constrain(News.class);
    query.descend("fLinkText").constrain(newsItem.getLink().toString()); //$NON-NLS-1$
    return activateAll(query.execute());
  }

  private List<INews> setState(List<INews> news, State state, boolean force) {
    List<INews> changedNews = new ArrayList<INews>(news.size());
View Full Code Here

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

  @SuppressWarnings("unchecked")
  private List<INews> getNewsFromGuid(INews newsItem) {
    Query query = fDb.query();
    query.constrain(News.class);
    query.descend("fGuidValue").constrain(newsItem.getGuid().getValue()); //$NON-NLS-1$
    return activateAll(query.execute());
  }

  public final List<ILabel> loadLabels() {
    try {
View Full Code Here

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

  }

  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.descend()

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

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

  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) {
      throw new PersistenceException(e);
View Full Code Here

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

  }

  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

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

  }

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

    if (marks.size() == 1) {
View Full Code Here

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

  }

  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
  protected void preSave(T entity) {
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.