-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: JPA: mapping situation: List<? extend someClass>
PostPosted: Tue Apr 15, 2008 3:24 am 
Newbie

Joined: Tue Apr 15, 2008 3:20 am
Posts: 1
Hi everyone,

For the mapping case of List <? extends someClass>, it is clear to see that this mapping is a combination of class association (One-to-Many) and inheritance.

I can handle this mapping, database schema can be generated, storing and retrieving objects also no any problem.

But I encounter the problem of over-writing the old list in database with the new list in client code even though I have used "DELETE_ORPHAN" extended annotation from Hibernate.

Please notice that, for the mapping case of List<someConcreteClass>, the "DELETE_ORPHAN" extended annotation can help to solve the problem.
But for the mapping of List<? extend someClass>, it does not help at all.

I always get the following error:
Code:
org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance

Attached is the class diagram for the data model which describe that a Person has a list of BillingDetails which can be either BankAccount or CreditCard

Any reply, suggestion or help is very welcome.

Thanks much

Message was edited by: ttt_jpa


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.