From: Son To <son...@ya...> - 2002-03-01 07:36:02
|
Before I go on, I want to make sure my terminology is right. A persistent object is an object that gets instantiated by calling Session.create(Class) and a transient object is one created the normal way using new. OK now for my question... suppose: Session session = ...; Receipt receipt = (Receipt)session.create(Receipt.class); Product p = (Product)session.load(Product.class, new Long(0)); LineItem item = new LineItem(); item.setProduct(p); item.setQuantity(3); receipt.addLineItem(item); session.commit(); Receipt contains a List of LineItem. This list is declared in the xml, but hibernate runtime does not persist the transient object. Is this a feature or a bug? thanks, son __________________________________________________ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.yahoo.com |