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

Chris Wilson (JIRA) noreply at atlassian.com
Tue Dec 1 05:54:08 EST 2009


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

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