Questions tagged as 'criteria'

0
answers

Adding results

I'm starting to use the framework uaiCriteria and I need a result that is a sum of records in a given period. Something like (simplified): select sum(valor), sum(desconto), data, idpessoa from tabela group by data, idpessoa I did:...
asked by 18.11.2014 / 18:00
1
answer

Problem with Like for Criteria

Good morning. I have a table in the following format: Ineedtomakeaselecttoreturnthesumofthevaluesoftheinfrastructuregroupedbyyear.IcreatedthisqueryinSQL:selectYEAR(dataCompraInfra),sum(valorCompraInfra),sum(valorVendaInfra)fromconcessaoin...
asked by 05.09.2015 / 15:55
1
answer

How to make a Criteria Join for this query

By searching a little I realized that there are some ways to make a Join using criteria. One of them is using an alias and one using a root. How to do the query below in Criteria using the 2 forms and which of the two would be the best (be...
asked by 23.03.2018 / 11:55
1
answer

Create selects with hibernate criteria generic

I'm doing a web-based, administrative software, it has several graphs and several tables, the problem with this is that several graphs and tables generate many queries to the database, and with this, many classes that have a similar structure, F...
asked by 13.12.2016 / 14:14
1
answer

Dynamic query using JPQL

I need to implement a dynamic query logic, in the DB using JPQL, and I have 4 filters:    1 - PROJECT COORDINATOR   2 - SERVICE PROVIDER   3 - DATE START OF THE PROJECT   4 - FINAL DATE OF THE PROJECT Any of the fields can be combined...
asked by 23.12.2016 / 15:01
1
answer

Types problem with ProjectionList in criteria

I have a problem with java giving the following error: in class: com.app.myApp.ReportDTO, setter method of property: indicator expected type: java.lang.Double, actual value: java.lang.IntegerInteger What happens in my criteria when creating...
asked by 18.02.2016 / 16:43
0
answers

error: session can not resolved

In the code below I'm getting the message: session can not resolved which prevents you from running the code snippet. package controler; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.criterion.Restriction...
asked by 27.11.2018 / 16:47
0
answers

Criteria with MongoDB

I would like to pass in a certain endpoint a filter ex "MyClasseVO", in a single endpoint can do several filtering. With criteria / Jpa + relational database I can do perfectly, someone would have some tutorial or hint using MongoDB to do this k...
asked by 12.10.2018 / 20:22
0
answers

How to make a query criteria that concatenates 3 columns

I need to make a query in Criteria that concatenates 3 fields. Example: Criteria c = session.createCriteria(A.class, "A"); ProjectionList p = Projections.projectionList(); p.add(Projections.property("A.grupo")); p.add(Projections.property...
asked by 26.03.2018 / 20:33
0
answers

Paging with criteria.distinct_root_entity

I'm developing Java web application and came across a problem. I have a n: n relationship between DateTime and DateTime and it is returning duplicate data when I make a query ... I can return the situation using criteria.setResultTransformer (Cr...
asked by 15.03.2018 / 20:35