Examples of constrain()


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());
      if (!states.containsAll(EnumSet.allOf(INews.State.class))) {
        Constraint constraint = null;
        for (INews.State state : states) {
          if (constraint == null)
View Full Code Here

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

 
  public final IConditionalGet loadConditionalGet(URL link) throws PersistenceException  {
    Assert.isNotNull(link, "link cannot be null"); //$NON-NLS-1$
    try {
      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) {
View Full Code Here

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

  }
 
  private <T extends IEntity>T loadEntity(Class<T> klass, long id)  {
    try {
      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) {
View Full Code Here

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

  }

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

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

  }

  private void deleteFeedIfNecessary(IBookMark mark) {
    //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)) {
View Full Code Here

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

  }

  private boolean onlyBookMarkReference(IFeed feed) {
    //TODO Share logic with IApplicationLayer method that does the same
    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();
View Full Code Here

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

  }

  public Collection<IFolder> loadRoots() {
    try {
      Query query = fDb.query();
      query.constrain(fEntityClass);
      query.descend("fParent").constrain(null); //$NON-NLS-1$
      List<IFolder> folders = getList(query);
      activateAll(folders);
      return new ArrayList<IFolder>(folders);
    } catch (Db4oException e) {
View Full Code Here

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

    for (INewsBin newsBin : newsBins) {
      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());
View Full Code Here

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

  }

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