Let's say I have a persistent class Item with a quantity field and a price field.
Is there a way to build a Criteria that calculates the sum of quantity*price?
Java – Expressions in hibernate criteria
hibernatejava
Related Question
- Java – JPA and Hibernate – Criteria vs. JPQL or HQL
- Java – How to call one constructor from another in Java
- Java – How to read / convert an InputStream into a String in Java
- Java – What are the possible values of the Hibernate hbm2ddl.auto configuration and what do they do
- Java – Any way to declare an array in-line
- Java – How to avoid Java code in JSP files, using JSP 2
- Java – a JavaBean exactly
- Java – What’s the difference between @Component, @Repository & @Service annotations in Spring
Best Solution
I think you can also use an SQL projection. It should be something like:
Ori