users@glassfish.java.net

Re: How to Sort / OrderBy _at_OneToMany

From: <glassfish_at_javadesktop.org>
Date: Mon, 17 Sep 2007 12:43:38 PDT

Converted from Collection to List.

I have the @OrderBy attribute in the last bit of code I referenced:
@OneToMany(mappedBy="owner",cascade=CascadeType.ALL)
@OrderBy("id")
List<Objectattributes> Attributes;

Is that correct?

Can I order by a specific field in the Objectattributes table? For instance, there is a field that is essentially the public method name. I would like to sort/order by that field.
[Message sent by forum member 'rmccullough' (rmccullough)]

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