I have an entity (A) which has a one to many dependency to another entity (B).
My problem is that in the database there is about one and a half million rows of B per one row of A. I am only interested in the newest row of B which do not have an historic date set.
I cannot find any examples of this using @-annotations (JDK 5.0+), but only XML.
Is this not possible without using XML?
I can deal with the historic date issue, but how can I determine restrictions/sorting on a field called REGISTERED_DATE?
Code:
@OneToMany(mappedBy="...")
@Where(clause = HISTORIC_DATE + " is null")
private List<B> bs = new ArrayList<B>();