Home » Search

About CriteriaQuery

51-60 of 85Refresh
Forum
5

ObjectDB CRUD Examples

(); CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder(); CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(Foo.class); Root root = criteriaQuery.from(Foo.class); List allFoo = (List) criteriaQuery.select(root); em.getTransaction
Issue
4

Weird issue with variable naming

with CriteriaQuery.toString(). I've tried three hours to replicate it without success, all I can say ... ; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery ... CriteriaBuilder cb = em.getCriteriaBuilder();   final CriteriaQuery cq = cb.createQuery
Forum
4

Object as parameter results in exception

, company});   CriteriaBuilder qb = getEntityManager().getCriteriaBuilder();   CriteriaQuery c = qb ... = getEntityManager().getCriteriaBuilder();   CriteriaQuery c = qb.createQuery(managedClass);   Root p = c ... please consider: Building the query (the CriteriaQuery and the TypedQuery) once with two parameters
Forum
3

Criteria Query results in a NoResultException instead of returning object

(); CriteriaQuery criteria = builder.createQuery(identityClass); Root root = criteria.from(identityClass ... i where i.name = :identityObjectName   My issue is that the CriteriaQuery version does not return ... of the CriteriaQuery and JPQL snippets: CriteriaBuilder builder = em.getCriteriaBuilder
Forum
3

How to convert a boolean to an int in the query?

:         CriteriaBuilder cb = em.getCriteriaBuilder();         CriteriaQuery q = cb.createQuery(Integer ... (); CriteriaQuery q = cb.createQuery(Integer.class); Root c = q.from ... .getCriteriaBuilder(); CriteriaQuery q = cb.createQuery(Integer.class); Root c
Forum
3

java.lang.ClassCastException: CriteriaQueryImpl cannot be cast to java.util.List

this thread.   The select method returns a CriteriaQuery instance (to be used for additional chained ... Query) instance from your CriteriaQuery and then execute the query using getResultList:     criteriaQuery.select(root);     TypedQuery query = em.createQuery(criteriaQuery);     allPersons
Issue
3

Issue with DISTINCT Select

() of the CriteriaQuery doesn't contain any variable named $3!!! And even worse.. when debugging in eclipse which calls the .toString() of the CriteriaQuery at different points in time, it happens that we get the same ... because the generated code from criteriaquery is NOT valid JPQL) -> you get the same issue.   thanks
Forum
3

Query in JPA2 with LEFT JOIN on INNER JOIN

, this is my critera query: CriteriaBuilder cb = entityManager.getCriteriaBuilder(); CriteriaQuery ... ); CriteriaQuery profileCriteriaQuery = cb.createQuery(BigDecimal.class); CriteriaQuery
Forum
3

Query results are not up to date for entities, not primitives

root(Class type) {   Root root = criteriaQuery.from(type); } private void select(Object object) {   ((CriteriaQuery) criteriaQuery).select((Selection) object); } For completeness
Forum
2

Calendar in Criteria Querys

();                 CriteriaBuilder cb = em.getCriteriaBuilder();         CriteriaQuery query1 = cb.createQuery();         Root ... ();         System.out.println(results.size());         CriteriaQuery query = cb.createQuery();         e