I have a standard Order - OrderLine relationship whereby the OrderLines run in the thousands and they contain binary data up to about 5 MB in data per OrderLine. Obviously I don't want to page them in all at the same time.
I have annotated my method with everything I could find:
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE })
@IndexColumn(name = "index", base = 0)
@LazyCollection(LazyCollectionOption.EXTRA)
@JoinTable(
name = "order2orderlines",
joinColumns = @JoinColumn(name="order_id"),
inverseJoinColumns = @JoinColumn(name="order_line_id")
)
public List<OrderLine> getOrderLines() {
return orderLines;
}
Were you able to find a solution to this problem? I am in a similar situation.