From open-jpa-dev-return-871-apmail-incubator-open-jpa-dev-archive=incubator.apache.org@incubator.apache.org Fri Oct 13 08:08:53 2006 Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 56400 invoked from network); 13 Oct 2006 08:08:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Oct 2006 08:08:52 -0000 Received: (qmail 65328 invoked by uid 500); 13 Oct 2006 08:08:52 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 65309 invoked by uid 500); 13 Oct 2006 08:08:52 -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 65300 invoked by uid 99); 13 Oct 2006 08:08:52 -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 01:08:52 -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 ppoddar@bea.com designates 63.96.162.5 as permitted sender) Received: from [63.96.162.5] (HELO ussjmh01.bea.com) (63.96.162.5) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Oct 2006 01:08:51 -0700 Received: from ussjfe01.amer.bea.com (ussjfe01b.bea.com [172.16.120.57]) by ussjmh01.bea.com (Switch-3.2.2/Switch-3.2.2) with ESMTP id k9D88GWm031085 for ; Fri, 13 Oct 2006 01:08:28 -0700 Received: from repbex01.amer.bea.com ([10.160.26.98]) by ussjfe01.amer.bea.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 13 Oct 2006 01:07:38 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 01:07:34 -0700 Message-ID: <5C219175D559A64D8C2CC65E41D3685649B5AC@repbex01.amer.bea.com> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Find by primary key does not return the real type of a record but instance of the type passed as parameter Thread-Index: AcbuKYP8rMkqqyTwTYKVHp+uYqMQBAAb08/wAAEsV1A= From: "Pinaki Poddar" To: X-OriginalArrivalTime: 13 Oct 2006 08:07:38.0422 (UTC) FILETIME=[A604E560:01C6EE9E] X-PMX-Version: 4.7.1.128075, Antispam-Engine: 2.4.0.264935, Antispam-Data: 2006.10.12.225442 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > Is it necessary to enhance all the classes at startup or could some = classes be enhanced only when they are first required ?=20 a) Kodo will enhance all persistent classes listed in tag of = META-INF/persistence.xml or b) setting "java -javagaent: myJPAApp" will enhance = classes before they are loaded in JVM. c) Kodo will attempt to enhance (if -javagaent is specified) when it = sees a class (unspecified in persistence.xml) entering managed regime = such as em.persist(obj) would trigger Kodo to see if obj.class is = enhanced and if not then will try to enhance it. =20 =20 Pinaki Poddar BEA Systems 415.402.7317 =20 -----Original Message----- From: Grenier Nicolas [mailto:Nicolas.Grenier@atosorigin.com]=20 Sent: Friday, October 13, 2006 12:35 AM To: open-jpa-dev@incubator.apache.org Subject: RE: Find by primary key does not return the real type of a = record but instance of the type passed as parameter Sorry, I forgot to join the root EJB you are right. Please find them attached. More information which could help: I'm using OpenJPA in my own = application server context meaning I use = createContainerEntityManagerFactory method to get a factory and use a = PersistenceUnitInfo implementation. I've seen that I was not correctly = enhancing all the classes (specifically the child ones) and guess it = could be the issue. I have corrected this problem, now I am sure all my = entity are all enhanced at runtime (I don't use tool enhancing); in = order to do this I force a loadClass on my class loader for all entity = classes. But I've still the same issue. Is it necessary to enhance all = the classes at startup or could some classes be enhanced only when they = are first required ?=20 -----Message d'origine----- De=A0: Abe White [mailto:awhite@bea.com] Envoy=E9=A0: jeudi 12 octobre 2006 20:04 =C0=A0: open-jpa-dev@incubator.apache.org; Grenier Nicolas Objet=A0: Re: = Find by primary key does not return the real type of a record but = instance of the type passed as parameter > My classes use the JOINED inheritance strategy. I use the default=20 > basic mappings and a sequence generator inside the root class. > I've joined the real classes, in fact the names of my classes are as=20 > follow (I renamed them in my previous mail for simplicity): > > Channel <- CommerceChannel <- Networking | Peripherals | Components These entities weren't included in the zip you sent. Could you please = send us these? You can strip out the class bodies if you want -- all I'm really interested in is the annotations on the classes = themselves, and the id field(s).=20 =20 _______________________________________________________________________ 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.