Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Order by primary key as a associated entity.
Order by primary key as a associated entity. [message #769596] Thu, 22 December 2011 11:49
Radek Hodain is currently offline Radek HodainFriend
Messages: 16
Registered: February 2010
Junior Member
Hi,

I have a question about ordering in JPA using EclipseLink. JPA 2.0 allows to define @Id to associated entity (as derived identity).

So I have entities like these:

@Table(name = "entity")
public class Entity {

.....
@Id
@ManyToOne()
@JoinColumn(name = "AE_ID")
private AssociatedEntity associated;

.....
}

@Table(name = "associated")
public class AssociatedEntity {

.....
@Id
@Column(name = "AE_ID")
private String code;
.....
}

Hibernate allows to use simething like this:

SELECT entity FROM ENTITY AS entity ORDER BY entity

which creates SQL like:

SELECT .... FROM entity t0 ORDER BY t0.AE_ID"

We know that JPA specification says that ORDER BY item must be a state_field_path_expression. Is in EclipseLink any posibility how to do the same (some hint or implementation specific resolution)?

Thanks

Radek
Previous Topic:remove without removing
Next Topic:JPA 2.0 @EmbeddedId mappings: bug with @MapsId in single-column identifying relationship?
Goto Forum:
  


Current Time: Fri Apr 26 19:16:39 GMT 2024

Powered by FUDForum. Page generated in 0.03182 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top