openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abe White <awh...@bea.com>
Subject Re: Find by primary key does not return the real type of a record but instance of the type passed as parameter
Date Fri, 13 Oct 2006 18:44:04 GMT
Thanks for sending the Channel base class.  The problem is actually  
very simple, and is explained here:

http://edocs.bea.com/kodo/docs41/full/html/ 
ejb3_overview_mapping_discrim.html

See the note about discriminator columns.  The bottom line is that  
when you use single-table inheritance mapping (as you do in your  
Channel hierarchy), OpenJPA doesn't automatically add a discriminator  
column when mapping the base class, because it would be a waste if  
you never add subclasses.  So you have to give OpenJPA some hint that  
you plan on subclassing the base class.  The note in the docs above  
give various ways of providing the necessary hint.

p.s. While these are Kodo docs, they apply fully to OpenJPA, which  
Kodo is built on.  Unfortunately we haven't posted official OpenJPA  
docs yet.
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

Mime
View raw message