Hi Patrick,

I'd suggest the best way to change a Student to a Person or vice versa is to do it via SQL without telling JPA at all.

Just be sure to invalidate the second level cache so you don't get phantoms.

Craig

On Feb 28, 2008, at 11:47 AM, Patrick T wrote:


Hello,

I have a problem. I hope you guys can help. I have a Person class (table x) and a Student class (table x and y). The Student class inherits from the Person class. The Student class spans two tables. The other table (y) are attributes that are unique to the Student class. My question is how can I
convert a Person to a Student or a Student back to a Person. Casting a
Student back to a Person and persisting does not get rid of its entry at table y. I contemplated on just using custom queries, but there has to be a
more appropriate code to do this.  Any help is appreciated. Thanks.

Patrick
--
View this message in context: 
http://www.nabble.com/mutating-an-inherited-class-tp15744348p15744348.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to