[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1043) Added HAVING Support to Criteria

Marco Brade (JIRA) noreply at atlassian.com
Fri Apr 25 08:07:34 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30073 ] 

Marco Brade commented on HHH-1043:
----------------------------------

I got the same failure. After using Projections.sqlGroupProjection(sql, groupBy, columnAliases, types) i got a lot of different failures.
Subqueries still don't work so I had to use joins build by criterias. Now I got the problem that with an scrollable result (for paging) I have duplicated entities in the result.

The solution for me was after combining all criterias to add another Restriction.
...
Criteria crit = buildComplexCriteria(...);

crit.add( Restrictions(" 1=1 group by {alias}.GroupById"));

Now I have the Entities I'm looking for as single entities.

Regards
Marco


> Added HAVING Support to Criteria
> --------------------------------
>
>                 Key: HHH-1043
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1043
>             Project: Hibernate3
>          Issue Type: Patch
>          Components: query-criteria
>    Affects Versions: 3.1 rc 1
>         Environment: 3.1 rc 1
>            Reporter: Tony Voss
>            Priority: Minor
>         Attachments: criteria-having-improvement.patch, criteria-having-improvement.zip
>
>
> I've added support for HAVING clauses to Criteria. Attached are my code changes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list