sum « Field « JPA Q&A

1. Can HQL substract or sum date fields?

A have two entities. For example timing settings and orders.

public class TimingSettings{

    private Long orderTimeout = 18000; //for example 18000 sec

2. Grails: sum of field within criteria builder

I'm at a loss of how to create a running sum of particular field after creating a criteria within a controller I'm currently creating a set of set of records using:


3. is it a bug or can't i use sum(field_a*fieldb)

4. How to sum of a numberic field result of distinct query

Hi I want to write a hql ( query in hibernate ) , My problem is that in my one query the result of that query is come using distinct , not i want to sum of one field carried out from that distinct query but it also distinct in sum method too. Can i use sub table in hql e.g ...