javax.persistence.criteria.CriteriaQuery.getParameters()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(174)

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

CriteriaQuery.getParameters介绍

[英]Return the parameters of the query. Returns empty set if there are no parameters. Modifications to the set do not affect the query.
[中]返回查询的参数。如果没有参数,则返回空集。对集合的修改不会影响查询。

代码示例

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Create a query from the given CritriaQuery.
 * Compile to register the parameters in this query.
 */
public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
  ((OpenJPACriteriaQuery<T>)criteriaQuery).compile(); 
  
  org.apache.openjpa.kernel.Query kernelQuery =_broker.newQuery(CriteriaBuilderImpl.LANG_CRITERIA, criteriaQuery);
  
  QueryImpl<T> facadeQuery = newQueryImpl(kernelQuery, null).setId(criteriaQuery.toString());
  Set<ParameterExpression<?>> params = criteriaQuery.getParameters();
  
  for (ParameterExpression<?> param : params) {
    facadeQuery.declareParameter(param, param);
  }
  return facadeQuery;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Create a query from the given CritriaQuery.
 * Compile to register the parameters in this query.
 */
public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
  ((OpenJPACriteriaQuery<T>)criteriaQuery).compile(); 
  
  org.apache.openjpa.kernel.Query kernelQuery =_broker.newQuery(CriteriaBuilderImpl.LANG_CRITERIA, criteriaQuery);
  
  QueryImpl<T> facadeQuery = newQueryImpl(kernelQuery, null).setId(criteriaQuery.toString());
  Set<ParameterExpression<?>> params = criteriaQuery.getParameters();
  
  for (ParameterExpression<?> param : params) {
    facadeQuery.declareParameter(param, param);
  }
  return facadeQuery;
}

代码示例来源:origin: org.apache.openjpa/openjpa-persistence

/**
 * Create a query from the given CritriaQuery.
 * Compile to register the parameters in this query.
 */
public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
  ((OpenJPACriteriaQuery<T>)criteriaQuery).compile(); 
  
  org.apache.openjpa.kernel.Query kernelQuery =_broker.newQuery(CriteriaBuilderImpl.LANG_CRITERIA, criteriaQuery);
  
  QueryImpl<T> facadeQuery = newQueryImpl(kernelQuery, null).setId(criteriaQuery.toString());
  Set<ParameterExpression<?>> params = criteriaQuery.getParameters();
  
  for (ParameterExpression<?> param : params) {
    facadeQuery.declareParameter(param, param);
  }
  return facadeQuery;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-persistence

/**
 * Create a query from the given CritriaQuery.
 * Compile to register the parameters in this query.
 */
public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
  ((OpenJPACriteriaQuery<T>)criteriaQuery).compile(); 
  
  org.apache.openjpa.kernel.Query kernelQuery =_broker.newQuery(CriteriaBuilderImpl.LANG_CRITERIA, criteriaQuery);
  
  QueryImpl<T> facadeQuery = newQueryImpl(kernelQuery, null).setId(criteriaQuery.toString());
  Set<ParameterExpression<?>> params = criteriaQuery.getParameters();
  
  for (ParameterExpression<?> param : params) {
    facadeQuery.declareParameter(param, param);
  }
  return facadeQuery;
}

代码示例来源:origin: com.walterjwhite.infrastructure.datastore.modules/google-guice-persist-criteria-builder

/** Use ES here, it would be more efficient. */
 public void search() {
  //    criteriaBuilder.equal()
  CriteriaQuery<Long> criteriaQuery = null;
  criteriaQuery.getParameters();
  criteriaQuery.getGroupList();
  criteriaQuery.getOrderList();
  criteriaQuery.getGroupRestriction();
  criteriaQuery.getRestriction();
  criteriaQuery.getSelection();

  final Predicate predicate = null;
 }
}

相关文章