List of usage examples for javax.persistence.criteria CriteriaQuery getParameters
Set<ParameterExpression<?>> getParameters();
From source file:org.apache.openjpa.persistence.EntityManagerImpl.java
/** * Create a query from the given CritriaQuery. * Compile to register the parameters in this query. *///from ww w. j ava2s . com 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, _log).setId(criteriaQuery.toString()); Set<ParameterExpression<?>> params = criteriaQuery.getParameters(); for (ParameterExpression<?> param : params) { facadeQuery.declareParameter(param, param); } return facadeQuery; }