Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 76920 invoked from network); 13 Oct 2006 18:44:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Oct 2006 18:44:16 -0000 Received: (qmail 29248 invoked by uid 500); 13 Oct 2006 18:44:16 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 29230 invoked by uid 500); 13 Oct 2006 18:44:16 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 29215 invoked by uid 99); 13 Oct 2006 18:44:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Oct 2006 11:44:16 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of awhite@bea.com designates 63.96.176.25 as permitted sender) Received: from [63.96.176.25] (HELO uslcmh01.bea.com) (63.96.176.25) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Oct 2006 11:44:14 -0700 Received: from [192.168.1.2] ([10.43.242.178]) by uslcmh01.bea.com (Switch-3.2.2/Switch-3.2.2) with ESMTP id k9DIhjZ0019453; Fri, 13 Oct 2006 14:43:46 -0400 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: References: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Abe White 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 11:44:04 -0700 To: open-jpa-dev@incubator.apache.org, Grenier Nicolas X-Mailer: Apple Mail (2.752.2) X-PMX-Version: 4.7.1.128075, Antispam-Engine: 2.4.0.264935, Antispam-Data: 2006.10.13.71442 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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.