[jboss-user] [EJB 3.0] - My collection is not initializing; due to inheritance?
SmokingAPipe
do-not-reply at jboss.com
Wed Aug 16 21:59:18 EDT 2006
I have a Person class, which keeps a List of MailingAddress objects. There is a sub-class of Person called Customer which adds a few fields. The MailingAddress itself is a sub-class of an Address object. Person has @OneToMany annotation on its MailingAddress collection, and Address has a @ManyToOne annotation on its Person member.
When I use a PersistenceManager to load up a Customer from the DB, the list of MailingAddresses is always empty.
Is this type of use supported? When I create a new Customer, I also create a new MailingAddress. I set the MailingAddress in the Customer and then I persist the Customer, and I can see it is all saved in the db. But when I load the Customer back, it gives me an empty List. I think it's not even a proxy; it's just a plain old Java List.
I know there are two inheritances happening here: Customer is a subclass of Person, and MailingAddress is a subclass of Address. Should this be working?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965610#3965610
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965610
More information about the jboss-user
mailing list