[ 
https://issues.apache.org/jira/browse/JUDDI-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634565#action_12634565
 ] 

Jeff Faath commented on JUDDI-142:
----------------------------------

I did some more research and found a good solution.  We simply need to add the 
@OrderBy annotation to simple collections (these collections have the parent 
entity key and an integer as their primary key).  Adding the annotation without 
any arguments will sort the collection on the primary key and since the integer 
id preserves their insert order, all is good.

For the more high-level collections (ex. business services for a business 
entity) this solution won't work.  But these collections have a timestamp (the 
last Updated field).  However, I'm not sure it's as important to preserve the 
order of these higher level collections since they are entities unto themselves.

I'm going to try out this solution for two model classes I'm working with now.  
I'll commit these two classes if the solution works out.

> JPA retrievals result in sporadic ordering of collections
> ---------------------------------------------------------
>
>                 Key: JUDDI-142
>                 URL: https://issues.apache.org/jira/browse/JUDDI-142
>             Project: jUDDI
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Jeff Faath
>            Assignee: Kurt Stam
>             Fix For: 3.0
>
>
> When retrieving results from the persistence layer (currently using 
> Hibernate), collections of objects are coming back with sporadic ordering.  I 
> cannot identify the any concrete reasons as it doesn't happen every time and 
> to every collection.
> Not only is it causing havoc with the unit tests, it is probably desirable 
> that results are returned in the order that they're are saved.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to