List of usage examples for javax.persistence.criteria CriteriaQuery toString
public String toString()
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 av a 2s . co m 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; }