Package com.db4o.query

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


              break;
            case NOT_EQUALS:
              pquery.constrain(checkValue).not();
              break;
            case STARTS_WITH:
              pquery.constrain(checkValue).startsWith(ctn.isCaseSensitive());
              break;
          } // comparator switch
        }
      }
    }
View Full Code Here


   * @param type
   * @param sorting optional
   */
  protected <E> List<E> loadAllOfType(Class<E> type, Sorting sorting) {
    final Query q = getDb4oTemplate().query();
    q.constrain(type);
    applySorting(q, sorting);
    return runQuery(q);
  }

  /**
 
View Full Code Here

        sq = q.descend("isAvailableMerchant");
      else if("customer".equals(et))
        sq = q.descend("isAvailableCustomer");
      else
        throw new InvalidCriteriaException();
      sq.constrain(Boolean.TRUE);
    }

    else
      throw new InvalidCriteriaException("Unhandled named query: " + qname);
  }
View Full Code Here

    if(criteria.getCriteriaType().isQuery()) {
      if(nqt == null) throw new InvalidCriteriaException("No db4o named query translator specified.");
      nqt.translateNamedQuery(criteria.getNamedQueryDefinition(), criteria.getQueryParams(), query);
    }
    else {
      query.constrain(criteria.getEntityClass());
      final CriterionGroup pg = criteria.getPrimaryGroup();
      if(pg != null && pg.isSet()) {
        for(final ICriterion ic : pg) {
          if(ic.isGroup()) throw new InvalidCriteriaException("Nested criterion groups are not supported");
          if(!ic.isSet()) throw new InvalidCriteriaException("criterion not set");
View Full Code Here

              // presume an object array
              final Object[] oarr = (Object[]) checkValue;
              min = oarr[0];
              max = oarr[1];
            }
            pquery.constrain(min).greater().equal().or(pquery.constrain(max).smaller().equal());
            break;
          }
          case CONTAINS:
            pquery.constrain(checkValue).contains();
            break;
View Full Code Here

              // presume an object array
              final Object[] oarr = (Object[]) checkValue;
              min = oarr[0];
              max = oarr[1];
            }
            pquery.constrain(min).greater().equal().or(pquery.constrain(max).smaller().equal());
            break;
          }
          case CONTAINS:
            pquery.constrain(checkValue).contains();
            break;
View Full Code Here

            }
            pquery.constrain(min).greater().equal().or(pquery.constrain(max).smaller().equal());
            break;
          }
          case CONTAINS:
            pquery.constrain(checkValue).contains();
            break;
          case ENDS_WITH:
            pquery.constrain(checkValue).endsWith(ctn.isCaseSensitive());
            break;
          case EQUALS:
View Full Code Here

          }
          case CONTAINS:
            pquery.constrain(checkValue).contains();
            break;
          case ENDS_WITH:
            pquery.constrain(checkValue).endsWith(ctn.isCaseSensitive());
            break;
          case EQUALS:
            if(!ctn.isCaseSensitive())
              throw new InvalidCriteriaException("Case insensitive equals checking is currently not supported");
            pquery.constrain(checkValue);
View Full Code Here

            pquery.constrain(checkValue).endsWith(ctn.isCaseSensitive());
            break;
          case EQUALS:
            if(!ctn.isCaseSensitive())
              throw new InvalidCriteriaException("Case insensitive equals checking is currently not supported");
            pquery.constrain(checkValue);
            break;
          case GREATER_THAN:
            pquery.constrain(checkValue).greater();
            break;
          case GREATER_THAN_EQUALS:
View Full Code Here

            if(!ctn.isCaseSensitive())
              throw new InvalidCriteriaException("Case insensitive equals checking is currently not supported");
            pquery.constrain(checkValue);
            break;
          case GREATER_THAN:
            pquery.constrain(checkValue).greater();
            break;
          case GREATER_THAN_EQUALS:
            pquery.constrain(checkValue).greater().equal();
            break;
          case IN: {
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.