Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] OrderBy Annotation

Hello,

we've got a collection:

@Entity class Vehicle {
  @OneToMany(cascade={CascadeType.MERGE, CascadeType.REFRESH, CascadeType.REMOVE},
fetch=FetchType.LAZY, mappedBy="leadTruck")
  @OrderBy("seqno ASC")
  @JoinFetch(value=JoinFetchType.OUTER) // Never remove this, or you will regret it - believe me
you will.
  private List<Tour> tours = new ArrayList<Tour>(113);
}

@Entity class Tour {
  @Column(name = "seqno")
  private int seqno = 0;
}

When the tours of a vehicle are fetched from database the "seqno" of the tours are numbered
1,..N regardless of the value "seqno" has in the database.

E.g., the "tour.seqno" values in the database are 43, 44, 45, then we get tours with seqno set
to 1, 2, 3.

IMHO, according to the specification this is not correct.
Is this a known bug, or do I misunderstand the specification?

Kind Regards,
Michael


Back to the top