[hibernate-issues] [Hibernate-JIRA] Resolved: (ANN-448) @OrderBy does not work with an association table when Set is used for collection

Emmanuel Bernard (JIRA) noreply at atlassian.com
Thu Nov 30 14:59:05 EST 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-448?page=all ]
     
Emmanuel Bernard resolved ANN-448:
----------------------------------

    Resolution: Fixed
     Assign To: Emmanuel Bernard

Fixed in Hibernate Core 3.2.2, test added to HAN

> @OrderBy does not work with an association table when Set is used for collection
> --------------------------------------------------------------------------------
>
>          Key: ANN-448
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-448
>      Project: Hibernate Annotations
>         Type: Bug

>     Versions: 3.2.0.cr2
>  Environment: Hibernate 3.2CR4, Oracle 10
>     Reporter: Mike Wilson
>     Assignee: Emmanuel Bernard
>      Fix For: 3.2.1
>  Attachments: patch.txt
>
>
> We are using Set for our mapped collections, and not Collection like in the unit tests for annotations. We can see that the items are inserted in the Set according to the order governed by @OrderBy, but apparently Hibernate is not using an order-preserving Set like f ex LinkedHashSet. 
> We were under the impression that Hibernate would support ordered Sets by using a suitable (ordered) Set subclass when an @OrderBy is specified and this is confirmed by Emmanuel on http://forum.hibernate.org/viewtopic.php?p=2324711.
> I supply a patch file that adds a new test case to the annotations "ManyToMany" test:
> GroupWithSet.java: 
> - property "permissions" as Set instead of Collection
> ManyToManyTest.java: 
> - new method "testAssociationTableAndOrderByWithSet()" with:
>   . using GroupWithSet
>   . added an extra permission + check order of all three perms to avoid the 50% chance of random order being correct 
> (And I have tested by running against CVS HEAD version)
> Best regards
> Mike Wilson

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