Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 28511 invoked from network); 15 Mar 2006 22:50:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Mar 2006 22:50:26 -0000 Received: (qmail 31090 invoked by uid 500); 15 Mar 2006 22:50:26 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 31079 invoked by uid 99); 15 Mar 2006 22:50:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Mar 2006 14:50:26 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.34] (HELO brmea-mail-3.sun.com) (192.18.98.34) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Mar 2006 14:50:25 -0800 Received: from fe-amer-04.sun.com ([192.18.108.178]) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id k2FMo5Qj018236 for ; Wed, 15 Mar 2006 15:50:05 -0700 (MST) Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0IW600I01XUWZY00@mail-amer.sun.com> (original mail from Craig.Russell@Sun.COM) for jdo-dev@db.apache.org; Wed, 15 Mar 2006 15:50:05 -0700 (MST) Received: from [192.168.0.10] (c-24-6-172-77.hsd1.ca.comcast.net [24.6.172.77]) by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0IW600M3VY3G2X10@mail-amer.sun.com> for jdo-dev@db.apache.org; Wed, 15 Mar 2006 15:50:05 -0700 (MST) Date: Wed, 15 Mar 2006 14:50:01 -0800 From: Craig L Russell Subject: Re: JPOX issues In-reply-to: <1142459994.44188e5adfdfd@webmail.jpox.org> Sender: Craig.Russell@Sun.COM To: jdo-dev@db.apache.org Message-id: <37B411DC-AE10-40E0-8709-422482464972@Sun.COM> MIME-version: 1.0 X-Mailer: Apple Mail (2.746.2) Content-type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-200-947045539; micalg=sha1 References: <49D83A14-B322-48EC-85A8-3951BEC7D731@Sun.COM> <1142371266.441733c2a679f@webmail.jpox.org> <8D762E1E-AC77-4D9D-9983-6C2C12CF285D@Sun.COM> <1142381086.44175a1e30573@webmail.jpox.org> <1142459994.44188e5adfdfd@webmail.jpox.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --Apple-Mail-200-947045539 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Hi Erik, Sorry, I thought I had answered this but found the message in my "to =20 be sent" box. The instance returned from newInstance is transient. The application =20 treats the new instance just like an instance created via the "new PC=20 ()" method call. An example implementation is: Object newInstance(Class pcClass) { if (it's a persistent interface or abstract class) { ... construct your implementation based on metadata } else if (PersistenceCapable.class.isAssignableFrom(pcClass) { return pc.getConstructor(new Class[ ]{}).newInstance(); // =20 throws if abstract class or no privileges } else { throw JDOUserException... } } Craig The following method is used to create an instance of a persistence-=20 capable interface, or of a concrete or abstract class. Object newInstance(Class persistenceCapable); The parameter must be one of the following: =95an abstract class that is declared in the metadata using the class =20= element, or =95an interface that is declared in the metadata using the interface =20 element, or =95a concrete class that is declared in the metadata as persistence-=20 capable. In this case, the concrete class must declare a public no-args constructor. The returned instance is transient, and is an =93instanceof=94 the =20 parameter. Applications might use the instance via the get and set property methods and =20 change its life cycle state exactly as if it were an instance of a persistence-capable class. In order for the newInstance method to be used, the parameter =20 interface must be com- pletely mapped. For relational implementations, the interface must be =20= mapped to a table and all persistent properties must be mapped to columns. =20 Additionally, interfaces that are the targets of all relationships from persistent properties=FE must =20 also be mapped. Otherwise, JDOUserException is thrown by the newInstance method. For interfaces and classes that use a SingleFieldIdentity as the =20 object-id class, if the returned instance is subsequently made persistent, the target class =20 stored in the object-id instance is the parameter of the newInstance method that created it. On Mar 15, 2006, at 1:59 PM, Erik Bengtson wrote: > Hi, > > All issues in JPOX were solved but not the ones related to the =20 > newInstance > tests. > >> It's not clear to me in what state must be the instance created by =20= >> this >> method. > > Can someone answer this? > > Quoting Erik Bengtson : > >> Craig, >> >> It's not clear to me in what state must be the instance created by =20= >> this >> method. >> Can you clarify? >> >> Thanks >> >> Quoting Craig L Russell : >> >>> Hi Erik, >>> >>> On Mar 14, 2006, at 1:21 PM, Erik Bengtson wrote: >>> >>>> Can someone with spring understanding check JDO-327 ? >>> >>> Your symptom is different from mine. Have you checked in all the =20 >>> code >>> that gives you the error on pm.newInstance(IDentalInsurance.class) ? >>> >>>> >>>> With me >>>> JDO-241 >>>> JDO-246 (Issue in derby, needs workaround implemented in JPOX) >>>> JDO-337 (to be fixed tonight) >>>> >>>> Work not started >>>> JDO-326 (abstract class support) >>> >>> Note that this is not abstract class support. The parameter is a >>> concrete class. "All the implementation has to do" is to recognize >>> that the parameter is PersistenceCapable, and call the =20 >>> jdoNewInstance >>> () method that's enhanced into the class. >>> >>> Regards, >>> >>> Craig >>>> >>>> >>>> Quoting Craig L Russell : >>>> >>>>> Hi, >>>>> >>>>> I'm looking at JDO JIRA issues 241, 246, 326, 327, and 337, and =20= >>>>> I'm >>>>> assuming that these issues are being looked at by the JPOX folks. >>>>> >>>>> Please correct me if there's some TCK activity needed here. >>>>> >>>>> Thanks, >>>>> >>>>> Craig >>>>> >>>>> Craig Russell >>>>> Architect, Sun Java Enterprise System http://java.sun.com/=20 >>>>> products/ >>>>> jdo >>>>> 408 276-5638 mailto:Craig.Russell@sun.com >>>>> P.S. A good JDO? O, Gasp! >>>>> >>>>> >>>> >>>> >>>> >>> >>> Craig Russell >>> Architect, Sun Java Enterprise System http://java.sun.com/=20 >>> products/jdo >>> 408 276-5638 mailto:Craig.Russell@sun.com >>> P.S. A good JDO? O, Gasp! >>> >>> >> >> >> >> > > > Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:Craig.Russell@sun.com P.S. A good JDO? O, Gasp! --Apple-Mail-200-947045539 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGUDCCAwkw ggJyoAMCAQICEB7Y7fLHmKoeHTUdbtYrvpAwDQYJKoZIhvcNAQEEBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA1MTIxNTIxNDc0NFoXDTA2MTIxNTIxNDc0 NFowbDEQMA4GA1UEBBMHUnVzc2VsbDEUMBIGA1UEKhMLQ3JhaWcgTGFpcmQxHDAaBgNVBAMTE0Ny YWlnIExhaXJkIFJ1c3NlbGwxJDAiBgkqhkiG9w0BCQEWFUNyYWlnLlJ1c3NlbGxAU3VuLkNPTTCC ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMXXgEAm88nu8cFbxXSWqTq+GaYpCx/0QSom 8kBbVxpJIURuO4ErLDupeXu6y9+5e7ZKLbeSQE5xbfYPcQR/IhqmYKy5YqRcuzPXREBj2zKEkZph pNXWpHgMdx9W8dq0Cu2i9Ux/S6c2MuEHrP6gfGGll+b/mzLoO280QHTuE4pcpKntRnwZdGxQ/5l8 IL+eLP+jpJAbYW9C+KNKofZtS6V6R0uzlqTOsEdZvwxZQ4mmPgHoz1+Gjwme/PC5sKvF09MaJDiI pj9SvZ4CTCgcD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