Package com.db4o.query

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


    Query query = fDb.query();
    query.constrain(BookMark.class);
    query.descend("fFeedLink").constrain(feed.getLink().toString()); //$NON-NLS-1$

    @SuppressWarnings("unchecked")
    List<IBookMark> marks = query.execute();

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


      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();
        oc.activate(news, Integer.MAX_VALUE);
        String parentIdFieldName = "fParentId"; //$NON-NLS-1$
        MigrationHelper.setField(news, parentIdFieldName, newsBin.getId().longValue());
        oc.ext().store(news, Integer.MAX_VALUE);
      }
View Full Code Here

  @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

  @SuppressWarnings("unchecked")
  public static Collection<IBookMark> loadAllBookMarks(ObjectContainer db, FeedLinkReference feedRef) {
    Query query = db.query();
    query.constrain(BookMark.class);
    query.descend("fFeedLink").constrain(feedRef.getLink().toString()); //$NON-NLS-1$
    return query.execute();
  }

  static boolean feedHasNewsWithCopies(ObjectContainer db, FeedLinkReference feedRef) {
    Query query = db.query();
    query.constrain(News.class);
View Full Code Here

  static boolean feedHasNewsWithCopies(ObjectContainer db, FeedLinkReference feedRef) {
    Query query = db.query();
    query.constrain(News.class);
    query.descend("fFeedLink").constrain(feedRef.getLink().toString()); //$NON-NLS-1$
    query.descend("fParentId").constrain(0).not(); //$NON-NLS-1$
    return !query.execute().isEmpty();
  }

  public static void updateNewsCounter(ObjectContainer db) {
    List<EventRunnable<?>> eventRunnables = EventsMap.getInstance().getEventRunnables();
    NewsCounterService newsCounterService = new NewsCounterService(Owl.getPersistenceService().getDAOService().getNewsCounterDAO(), db);
View Full Code Here

            return;

          Query query = sourceDb.query();
          query.constrain(News.class);
          query.descend("fId").constrain(newsRef.getId()); //$NON-NLS-1$
          Iterator<?> newsIt = query.execute().iterator();
          if (!newsIt.hasNext()) {
            Activator.getDefault().logError("NewsBin " + newsBin + " has reference to news with id: " + newsRef.getId() + ", but that news does not exist.", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            staleNewsRefs.add(newsRef);
            continue;
          }
View Full Code Here

  private void deleteFeedIfNecessary(IBookMark mark) {
    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) {
      FeedLinkReference feedRef = new FeedLinkReference(feed.getLink());
      if (DBHelper.countBookMarkReference(fDb, feedRef) == 1) {
        if (DBHelper.feedHasNewsWithCopies(fDb, feedRef)) {
          List<INews> newsList = new ArrayList<INews>(feed.getNews());
View Full Code Here

 
  public List<FCPClient> findNonGlobalClients(NodeClientCore core, ObjectContainer container) {
      ArrayList<FCPClient> results = new ArrayList<FCPClient>();
    Query query = container.query();
    query.constrain(FCPClient.class);
    ObjectSet<FCPClient> set = query.execute();
    while(true) {
        try {
            if(set.hasNext()) {
                FCPClient client = set.next();
                try {
View Full Code Here

  }

  public static void retrieveAllPilots(ObjectContainer db) {
    Query query = db.query();
    query.constrain(Pilot.class);
    ObjectSet result = query.execute();
    listResult(result);
  }

  public static void retrievePilotByName(ObjectContainer db) {
    Query query = db.query();
View Full Code Here

  public static void retrievePilotByName(ObjectContainer db) {
    Query query = db.query();
    query.constrain(Pilot.class);
    query.descend("name").constrain("Michael Schumacher");
    ObjectSet result = query.execute();
    listResult(result);
  }

  public static void retrievePilotByExactPoints(ObjectContainer db) {
    Query query = db.query();
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.