Skip to main content

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

Hi Michael,

Our test framework has a number of testing models that use an @OrderBy annotation. The test I used to try this out was: testInheritedClone() in org.eclipse.persistence.testing.tests.jpa.inherited.InheritedModelJunitTest. The main difference here is likely that the data type is different from the one you are using. Although it is possible that making some datatype changes will result in this issue being recreatable, I suspect other changes have to be made as well - which is why I am hoping you can provide a recreation when you file the bug.

Thanks,
Tom



Michael Simons wrote:
Hello Tom,

where can I find the according test? May be I find a significant difference.

Kind Regards, Michael

Am 01.10.2010 14:58, schrieb Tom Ware:
Hi Michael,

  Based on your description, it seems like there is a bug.  When I run our tests, however, I do
not see this issue.

  Please file a bug and attach some recreation code.

-Fom

Michael Simons wrote:
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
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top