[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-4629) Add Criteria API to check collections for particular members

Chris Wilson (JIRA) noreply at atlassian.com
Tue Dec 1 07:10:14 EST 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Wilson updated HHH-4629:
------------------------------

    Attachment: hibernate-collection-contains.patch

Updated patch fixes a problem where the primary keys of the joined tables have different types.

> Add Criteria API to check collections for particular members
> ------------------------------------------------------------
>
>                 Key: HHH-4629
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4629
>             Project: Hibernate Core
>          Issue Type: Patch
>          Components: core
>    Affects Versions: 3.5
>            Reporter: Chris Wilson
>         Attachments: hibernate-collection-contains.patch, hibernate-collection-contains.patch
>
>   Original Estimate: 15 minutes
>  Remaining Estimate: 15 minutes
>
> Very few Criteria Restrictions apply to a collection. Currently as far as I can tell the only relevant ones are Restrictions.isEmpty() and isNotEmpty(). It's pretty useful to be able to check for a collection containing a particular value (object), like this:
>         org = session.createCriteria(Org.class);
>         org.add(Restrictions.contains("projects", project2));
>         assertEquals(Arrays.asList(new Org[]{org1, org2}), org.list());
> The attached patch implements this.

-- 
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