com.google.appengine.api.datastore.Query.getFilterPredicates()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中com.google.appengine.api.datastore.Query.getFilterPredicates方法的一些代码示例,展示了Query.getFilterPredicates的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getFilterPredicates方法的具体详情如下:
包路径:com.google.appengine.api.datastore.Query
类名称:Query
方法名:getFilterPredicates

Query.getFilterPredicates介绍

暂无

代码示例

代码示例来源:origin: com.google.appengine.orm/datanucleus-appengine

str.append(" ANCESTOR=" + primaryDatastoreQuery.getAncestor());
List<FilterPredicate> filterPreds = primaryDatastoreQuery.getFilterPredicates();
if (filterPreds.size() > 0) {
 str.append(" Filter : ");

代码示例来源:origin: com.googlecode.cedar-common/objectify

FilterPredicate[] filters = this.actual.getFilterPredicates().toArray(new FilterPredicate[this.actual.getFilterPredicates().size()]);
Arrays.sort(filters, new Comparator<FilterPredicate>() {
  @Override

代码示例来源:origin: com.google.appengine.orm/datanucleus-appengine

private void validateJoinQuery(QueryData qd, DatastoreQuery query, String joinSortProp) {
 // all filters on the primary must be equality
 for (Query.FilterPredicate fp : qd.primaryDatastoreQuery.getFilterPredicates()) {
  if (fp.getOperator() != Query.FilterOperator.EQUAL) {
   throw query.new UnsupportedDatastoreFeatureException(
     "Filter on property '" + fp.getPropertyName() + "' uses operator '" + fp.getOperator()
     + "'.  Joins are only supported when all filters are 'equals' filters.");
  }
 }
 // all filters on the join must be equality
 for (Query.FilterPredicate fp : qd.joinQuery.getFilterPredicates()) {
  if (fp.getOperator() != Query.FilterOperator.EQUAL) {
   throw query.new UnsupportedDatastoreFeatureException(
     "Filter on property '" + fp.getPropertyName() + "' uses operator '" + fp.getOperator()
     + "'.  Joins are only supported when all filters are 'equals' filters.");
  }
 }
 List<Query.SortPredicate> primarySorts = qd.primaryDatastoreQuery.getSortPredicates();
 // There must be 0 or 1 sort orders total.
 // If there is a sort order it must be on the join column in ascending order.
 // TODO(maxr): support sorting by join column in descending order
 if (primarySorts.size() > 1 || !qd.joinQuery.getSortPredicates().isEmpty() ||
   (!primarySorts.isEmpty() &&
   (!primarySorts.get(0).getPropertyName().equals(joinSortProp) ||
    primarySorts.get(0).getDirection() != Query.SortDirection.ASCENDING))) {
  throw query.new UnsupportedDatastoreFeatureException(
    "Joins can only be sorted by the join column in "
    + "ascending order (in this case '" + joinSortProp +"')");
 }    
}

代码示例来源:origin: org.vesalainen.dsql/dsql

for (FilterPredicate fp : query.getFilterPredicates())
  for (FilterPredicate fp : query.getFilterPredicates())

代码示例来源:origin: com.googlecode.cedar-common/objectify

/**
 * Make a new Query object that is exactly like the old.  Too bad Query isn't Cloneable. 
 */
protected com.google.appengine.api.datastore.Query cloneRawQuery(com.google.appengine.api.datastore.Query orig)
{
  com.google.appengine.api.datastore.Query copy = new com.google.appengine.api.datastore.Query(orig.getKind(), orig.getAncestor());
  
  for (FilterPredicate filter: orig.getFilterPredicates())
    copy.addFilter(filter.getPropertyName(), filter.getOperator(), filter.getValue());
  
  for (SortPredicate sort: orig.getSortPredicates())
    copy.addSort(sort.getPropertyName(), sort.getDirection());
  
  // This should be impossible but who knows what might happen in the future
  if (orig.isKeysOnly())
    copy.setKeysOnly();
  
  return copy;
}

代码示例来源:origin: com.google.appengine.orm/datanucleus-appengine

qd.primaryDatastoreQuery.getFilterPredicates().size() == 1 &&
qd.primaryDatastoreQuery.getSortPredicates().isEmpty()) {

相关文章