Package com.db4o.query

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


        if (LOG.isInfoEnabled())
            LOG.info("Retrieving account for account name: " + accountName);
        Query query = this.container.query();
        query.constrain(GDataAccount.class);
        query.descend("name").constrain(accountName).equal();
        ObjectSet set = query.execute();
        if (set.size() > 1)
            throw new StorageException(
                    "Account query returned not a unique result -- account name: "
                            + accountName);
        if (!set.hasNext())
View Full Code Here


    @SuppressWarnings("unchecked")
    private ServerBaseFeed getServerBaseFeed(String feedId)throws StorageException{
        Query query = this.container.query();
        query.constrain(ServerBaseFeed.class);
        query.descend("feed").descend("id").constrain(feedId);
        ObjectSet<ServerBaseFeed> feed =  query.execute();
        if (feed.size() > 1)
            throw new StorageException("Query for feed id " + feedId
                    + " returns more than one result");
        if (feed.size() < 1)
            throw new StorageException("can not find feed for given feed id -- "
View Full Code Here

    protected final ObjectSet<DownloadedMessageLink> getDownloadedMessagesAfterIndex(int index) {
        Query q = mDB.query();
        q.constrain(DownloadedMessageLink.class);
        q.descend("mBoard").constrain(this).identity();
        q.descend("mIndex").constrain(index).greater();
        return new Persistent.InitializingObjectSet<DownloadedMessageLink>(mFreetalk, q.execute());
    }
   
    private final DownloadedMessageLink getDownloadedMessageByIndex(int index) throws NoSuchMessageException {
        final Query q = mDB.query();
        q.constrain(DownloadedMessageLink.class);
View Full Code Here

   
    public final synchronized int getDownloadedMessageCount() {
      final Query query = mDB.query();
      query.constrain(DownloadedMessageLink.class);
      query.descend("mBoard").constrain(this).identity();
      return query.execute().size();
    }
   
    /**
     * Sanity check function for checking whether the given message really belongs to this board.
     * @throws IllegalArgumentException If the message does not belong to this board according to its board list or if it is an OwnMessage.
View Full Code Here

    ObjectSet<MessageList> messageLists;
    MessageListFetchFailedMarker marker;
   
    q = db.query();
    q.constrain(FetchFailedMarker.class);
    assertEquals(0, q.execute().size());
   
    q = db.query();
    q.constrain(MessageList.class);
    assertEquals(0, q.execute().size());
   
View Full Code Here

    q.constrain(FetchFailedMarker.class);
    assertEquals(0, q.execute().size());
   
    q = db.query();
    q.constrain(MessageList.class);
    assertEquals(0, q.execute().size());
   
    mMessageManager.onMessageListFetchFailed(author, WoTMessageList.assembleURI(author.getRequestURI(), 1), FetchFailedMarker.Reason.DataNotFound);
   
    q = db.query();
    q.constrain(FetchFailedMarker.class);
View Full Code Here

   
    mMessageManager.onMessageListFetchFailed(author, WoTMessageList.assembleURI(author.getRequestURI(), 1), FetchFailedMarker.Reason.DataNotFound);
   
    q = db.query();
    q.constrain(FetchFailedMarker.class);
    assertEquals(1, q.execute().size());
   
    mMessageManager.clearExpiredFetchFailedMarkers();
   
    q = db.query();
    q.constrain(FetchFailedMarker.class);
View Full Code Here

   
    mMessageManager.clearExpiredFetchFailedMarkers();
   
    q = db.query();
    q.constrain(FetchFailedMarker.class);
    markers = q.execute();
    assertEquals(1, markers.size());
   
    marker = (MessageListFetchFailedMarker)markers.next();
   
    assertTrue((CurrentTimeUTC.getInMillis() - marker.getDate().getTime()) < 10 * 1000);
 
View Full Code Here

    assertEquals(marker.getDate().getTime() + MessageManager.MINIMAL_MESSAGELIST_FETCH_RETRY_DELAY, marker.getDateOfNextRetry().getTime());
    assertEquals(false, marker.isRetryAllowedNow());
   
    q = db.query();
    q.constrain(MessageList.class);
    messageLists = q.execute();
    assertEquals(1, messageLists.size());
    assertEquals(messageLists.next().getID(), marker.getMessageListID());
   
    // Now we simulate a retry of the message list fetch
   
View Full Code Here

       
    mMessageManager.clearExpiredFetchFailedMarkers();
   
    q = db.query();
    q.constrain(FetchFailedMarker.class);
    markers = q.execute();
    assertEquals(1, markers.size());
    assertEquals(marker, markers.next());
   
    q = db.query();
    q.constrain(MessageList.class);
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.