Query field created by the @OrderColumn [message #778313] |
Thu, 12 January 2012 10:26 |
Alessandro Pacifici Messages: 2 Registered: January 2012 |
Junior Member |
|
|
I have an entity like this:
public class A {
@OneToMany
@OrderColumn(name = "MYORDER")
private List<B> bList;
...
}
I need to fetch from database some B objects ordered by the created MYORDER column.
If I define a field in B like this:
public class B {
@Column(name = "MYORDER")
private Integer order;
...
}
And I try to query with:
SELECT b FROM B b WHERE ... ORDER BY b.order
EclipseLink try to create the "MYORDER" column 2 times throwing an exception and doesn't create the B table.
I can't fetch A objects because I need to fetch some B objects belonging to different A objects (even no A objects)
How can I solve this?
Regards
Alessandro
[Updated on: Thu, 12 January 2012 10:37] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03462 seconds