Hibernate Criteria - Group Dates

3

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 of this alias. Within my sqlGroupProjection it does not recognize the aliases that hibernate from the classes.

Does anyone have any idea how to get around this situation or another way to group dates without using the "Extract" function?

    
asked by anonymous 16.05.2015 / 13:11

1 answer

2

I found the solution here: link

In the example says Oracle, but it worked in postgreSQL as well.

    
16.05.2015 / 14:22