users@glassfish.java.net

Re: A complex _at_OrderBy definition (JPA/Toplink)

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Jun 2007 16:11:04 PDT

Did you try the following:

@OneToMany(targetEntity="B.class")
@OrderBy ( "B.c" )
private Collection vB;

}

The JPA spec requires, that the OrderBy item is a field in the associated entity, so specifying
@OrderBy ( "B.c.myfield" )
might not work. Please see section "9.1.28 OrderBy Annotation" of the JPA spec.
[Message sent by forum member 'mf125085' (mf125085)]

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