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;
  | }
  | 

Everything works fairly well. getOrderLines().size() does a nice select that 
counts (based on the index column), getOrderLines().get(i) nicely loads up the 
the one item I want.

When I try to add an item using getOrderLines().add(orderLine) however, the 
world comes to an end -- the whole list is paged in. Is there any way around 
this other than just managing the list myself through queries?

This is with the JBoss CVS checkout of 2006-06-13 but I've been having this 
problem for a while now.





View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3950643#3950643

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3950643


_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to