Order by primary key as a associated entity. [message #769596] |
Thu, 22 December 2011 11:49 |
Radek Hodain 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
|
|
|
Powered by
FUDForum. Page generated in 0.03182 seconds