Questions tagged as 'criteria'

2
answers

Criteria API - Hibernate vs JPA 2

I'll try to phrase this question as unthinkingly as possible in the spirit of stackoverflow in English. For a new project I need to make the decision between using the JPA 2 or Hibernate API (while it is technically possible to mix the two, for...
asked by 18.12.2013 / 15:17
1
answer

Differences between Criteria and HQL

In the handouts I read and tutorials I followed Criteria is more used, however I identified myself more with HQL . But I have the following doubt, everything done with Criteria can do with HQL ? HQL example: //Sele...
asked by 04.08.2015 / 17:02
1
answer

Criteria do grails

Somebody please tell me what this $ {result [0] [0]} means, why did they put two pair of brackets? def criteria = Person.createCriteria() def result = criteria.list { projections { max('age') min('age') } } println "The maximum age i...
asked by 01.01.2016 / 21:21
1
answer

Using Criteria for sorting

In the system I am developing I am trying to use the criteria to be able to execute a query which I am not able to work with jpql, so I tried to execute according to the material that had been getting to that code. CriteriaBuilder crite = em.ge...
asked by 28.06.2017 / 20:40
1
answer

Product displayed is the smallest within the group (Criteria)

I have a function in the system that I'm developing that returns a batch list where the batch quantity is greater than zero, searching for the product name (foreign key). Until that point I have. When doing the search it returns me all lots of t...
asked by 18.03.2016 / 00:35
1
answer

Hibernate Criteria - Group Dates

Currently I can group dates using Projections.sqlGroupProjection (). When my date field is in the same class as I create Criteria, it works perfectly. The problem is when I create an alias, and the date field I want to group is within the class...
asked by 16.05.2015 / 13:11
2
answers

Make a query with criteria hibernate with Spring

Good evening, friends, I have a question. I have a Class called Proposal and another Call Client. In the client there is the CPF field and a Proposal has a Client. I need to search for proposta.cliente.cpf , but I can not, could y...
asked by 11.05.2018 / 04:18
1
answer

DTO with List using JpaCriteria

I have two entities OperatorDate and HourDate . These two entities have other relationships that when I search with rest, it comes very unnecessary. To avoid this, I have created two DTO tables, DotOperator and DoodOper , in order to set...
asked by 16.10.2018 / 14:42
0
answers

How to get the count and objects with criteria jpa?

I need to return the collation results and also the number of each item in a query with criteria jpa. public List<Dica> obterDicaPorUsuario(){ final CriteriaBuilder cb = getEntityManager().getCriteriaBuilder(); final CriteriaQue...
asked by 13.02.2018 / 17:48
0
answers

JPA Criteria - Using between with Subquery

   "The numbers at the beginning of the queries and the" criteria "were inserted to facilitate the explanation. (1 -...) (2 -...) (3 -...)" I need to do this in the JPA criteria: SELECT DISTINCT service.* FROM service AS service INNER...
asked by 06.12.2018 / 13:46