Examples of constrain()


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

  public IConditionalGet load(URI link) {
    Assert.isNotNull(link, "link cannot be null"); //$NON-NLS-1$
    try {
      Query query = fDb.query();
      query.constrain(fEntityClass);
      query.descend("fLink").constrain(link.toString()); //$NON-NLS-1$

      for (IConditionalGet entity : getList(query)) {
        fDb.activate(entity, Integer.MAX_VALUE);
        return entity;
View Full Code Here

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

    return null;
  }

  public IPreference load(String key) throws PersistenceException {
    Query query = fDb.query();
    query.constrain(fEntityClass);
    query.descend("fKey").constrain(key); //$NON-NLS-1$
    List<IPreference> prefs = getList(query);
    activateAll(prefs);
    if (!prefs.isEmpty()) {
      return prefs.iterator().next();
View Full Code Here

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

  }

  @Override
  protected void doDelete(ILabel entity) {
    Query query = fDb.query();
    query.constrain(News.class);
    query.descend("fLabels").constrain(entity); //$NON-NLS-1$
    @SuppressWarnings("unchecked")
    List<INews> news = query.execute();
    for (INews newsItem : news) {
      newsItem.removeLabel(entity);
View Full Code Here

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

    if (states.isEmpty())
      return new ArrayList<INews>(0);

    try {
      Query query = fDb.query();
      query.constrain(News.class);
      query.descend("fFeedLink").constrain(feedRef.getLink().toString()); //$NON-NLS-1$
      query.descend("fParentId").constrain(0); //$NON-NLS-1$
      if (!states.containsAll(EnumSet.allOf(INews.State.class))) {
        Constraint constraint = null;
        for (INews.State state : states) {
View Full Code Here

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

    if (originalStates.isEmpty())
      return;

    try {
      Query query = fDb.query();
      query.constrain(News.class);
      if (!originalStates.containsAll(EnumSet.allOf(INews.State.class))) {
        Constraint constraint = null;
        for (INews.State originalState : originalStates) {
          if (constraint == null)
            constraint = query.descend("fStateOrdinal").constrain(originalState.ordinal()); //$NON-NLS-1$
View Full Code Here

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

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

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

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

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

  }

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

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

  }

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

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

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