How to apply a default-restriction on Entity-Bean @OneToMany Relationships
问题 I have two entity models, Customer and Order. Each customer could have thousands of orders. I have a OneToMany and ManyToOne relationship between these two entities. How do I restrict this relationship's list to only top 10 orders? Is it possible to apply 'WHERE' condition as an attribute on @OneToMany or not? Like: @OneToMany("Where Order.orderNo > 100") My problem is when the object created by Entity Manager all Orders are created in memory. Lazy loading can not solve my consideration,