Any idea what's going on? NoSuchObjectLocalException
posted 10 years ago
I have a bean "Orders" which has a collection of OrderItem beans. The OrderItem has a compound primary key of: OrderId + ProductId. It also has a quantity attribute.
When i create the orders in an init method, and then check them in that same method, everything is fine.
When I call a "findOrdersByCustomer" method, it finds a collection of orders and then when I'm looping through the OrderItems for the first order, the following occurs:
1. I get the item via iterator.next(); 2. I pull the product out of the orderitem via orderItem.getProduct(); 3. I print out the primary key for the item via orderItem.getPrimaryKey(); 3a. It prints out (for primary key): OrderId,ProductId 4. I call orderItem.getQuantity()
What's going on? Just one method call earlier, the object returned that same exact primary key! Does anyone have any idea what I might be doing wrong?
Plus, if I do findByPrimaryKey(), it finds the OrderItem, but again, if I call getQuantity() it throws that same exception! What could be going on here? [ September 22, 2005: Message edited by: Dan Bizman ]