Dear all, I have to e ntity model like Customer and Order. Each customer could have thousand orders, well, I make OneToMany and ManyToOne relationship between these to entities. But the thing I want is how to restrict this relationship's list to only top 10 orders.
I mean if it is possible to apply 'WHERE' condition as an attribute on @OneToMany or not? Like:
@OntToMany("Where Order.orderNo > 100")
My problem is when the object created by Entity Manager all Orders created in memory. Lazy loading can not solve my consideration, because I need to get top 10 orders in default construction.
Regards