]
Chris Wilson updated HHH-4629:
------------------------------
Attachment: hibernate-collection-contains.patch
Updated patch fixes a problem with matching null values. It probably still doesn't
work, but at least it doesn't cause an NPE now.
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, 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: