users@glassfish.java.net

Re: How to Sort / OrderBy _at_OneToMany

From: <glassfish_at_javadesktop.org>
Date: Mon, 17 Sep 2007 18:19:55 PDT

If you always maintain the list in such a way that the order is correct (i.e. originally populating it in your desired order, and then adding elements into the appropriate locations instead of adding them to the end of the list), it will stay that way in memory.
I'm not sure how the updates can stay ordered in the database - the relationship is maped to a FK value only, not the whole row, so if you inserted corresponding entries in a different order, they won't be reordered for you.

HTH,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=235729