It all depends on the targetted database or language.
For querydsl-jpa, its only possible if you mapped the Duration to a duration type for your database through a custom type. You then need to generate the appropiate metamodel for it and register some custom functions. For the combination Hibernate / PostgreSQL / Hibernate-Types I've got this to work. The code is available at
https://github.com/jwgmeligmeyling/hibernate-types-querydsl-apt .
Different databases are going to require an alternative solution. And the solution is going to be different for i.e. `querydsl-sql` or `querydsl-collections` as well.
Op dinsdag 4 februari 2020 om 23:04:37 UTC+1 schreef Diego:
Sorry, there is no query yet because when trying to use Group By.sum, for example, only Number is accepted and my field is of type Duration.
I would like to know if there is a way to sum a field like mine that is of type Duration.
Thanks for listening!
Em sábado, 1 de fevereiro de 2020 14:03:22 UTC-3, Prasad B escreveu:
Didn't get your question? Can you please provide the SQL which you are trying to generate using query dsl?