openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Forrest Xia <forres...@gmail.com>
Subject @OrderBy not work?
Date Thu, 17 Sep 2009 14:57:58 GMT

Hi,

I tried @OrderBy on a list field, but whatever I set it, it always sorts the
target entity by the identity.

Code snip like this:

@Entity
public class B {
  @Id
  private f1;
  @Column
  private f2;
  @Column
  private f3;
}

@Entity
public class A {
  @Id
  private p1;
  @Column
  private p2;
  @OneToMany
  @OrderBy("f3 DESC")
  private Collection p3;
}

As the example, query p3, the return list's order is always by B's id "f1'
ascending, though I set to order by f3. Is it a known bug?

I am using OpenJPA 1.2.1 bundled in Geronimo. Thanks for any comments!

Regards, Forrest
-- 
View this message in context: http://n2.nabble.com/OrderBy-not-work-tp3663648p3663648.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message