Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 26525 invoked from network); 15 Aug 2006 21:21:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Aug 2006 21:21:07 -0000 Received: (qmail 26305 invoked by uid 500); 15 Aug 2006 21:21:06 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 26286 invoked by uid 500); 15 Aug 2006 21:21:06 -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 26277 invoked by uid 99); 15 Aug 2006 21:21:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Aug 2006 14:21:06 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of michael.d.dick@gmail.com designates 64.233.182.190 as permitted sender) Received: from [64.233.182.190] (HELO nf-out-0910.google.com) (64.233.182.190) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Aug 2006 14:21:05 -0700 Received: by nf-out-0910.google.com with SMTP id c29so469503nfb for ; Tue, 15 Aug 2006 14:20:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=F3prKghA/B0TJqFIb0DUE5STXQTM72J5mGbxjSHRi5NP4vwRc0VvlpU3ej5K/JOTerbrjHzmoQibZrpwYAnlUnOgoz4zWuuCB5cQo+qpqNs9GCXTRwVaefulb9nAdJ/mq5FU6imOC+BPegkN4UFx28XSjo33SN1ThMVrwhT+Rko= Received: by 10.49.43.11 with SMTP id v11mr1883133nfj; Tue, 15 Aug 2006 14:20:41 -0700 (PDT) Received: by 10.49.94.7 with HTTP; Tue, 15 Aug 2006 14:20:41 -0700 (PDT) Message-ID: <72c1350f0608151420p5120067ch494c515bf88ec4af@mail.gmail.com> Date: Tue, 15 Aug 2006 16:20:41 -0500 From: "Michael Dick" To: open-jpa-dev@incubator.apache.org Subject: Re: [jira] Commented: (OPENJPA-12) Default to strictIdentityTypes for JPA In-Reply-To: <18859702.1155662474348.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_95730_20236536.1155676841818" References: <3261822.1155331813809.JavaMail.jira@brutus> <18859702.1155662474348.JavaMail.jira@brutus> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_95730_20236536.1155676841818 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I think it would be better to pass the TCK without any properties that change behavior. Does anyone know if Sun has a guideline regarding the configuration properties? On 8/15/06, Patrick Linskey (JIRA) wrote: > > [ http://issues.apache.org/jira/browse/OPENJPA-12?page=comments#action_12428175 > ] > > Patrick Linskey commented on OPENJPA-12: > ---------------------------------------- > > I know that we changed this in our JPA TCK test-running environment via > the property setting. I guess the question at hand is whether the default > should be to be strict or to be lenient for JPA installations. Does anyone > have a dissenting opinion? > > > Default to strictIdentityTypes for JPA > > -------------------------------------- > > > > Key: OPENJPA-12 > > URL: http://issues.apache.org/jira/browse/OPENJPA-12 > > Project: OpenJPA > > Issue Type: Bug > > Components: jpa > > Reporter: Michael Dick > > Priority: Minor > > Attachments: patch.txt > > > > > > The default behavior with OpenJPA is to be very forgiving regarding the > Primary Key types passed in when calling EntityManager.find or > EntityManager.getReference . > > For example if an Entity has an ID of type Long OpenJPA will attempt to > convert anything that extend java.lang.Number and Strings (maybe others). > > This is a nice feature, but I don't think it should be the default > behavior. The JPA spec indicates that an IllegalArgumentException should be > thrown if the second argument is not a valid type for the Entity's primary > key. There is some room for interpretation as to what constitutes a valid > type, conversion for all Numbers makes sense, but String might be pushing > it. > > Workaround : > > Add the following to persistence.xml > > /> > > Proposed Solution : > > The OpenJPA compatibility plugin provides a mechanism to enforce strict > identity checking (defaulting to false). There's no need to change the > default in the kernel (other persistence apis like JDO might be more > lenient) so I propose changing the default in > PersistenceProductDerivation.beforeConfigurationLoad(). > > Changing it there should only effect the JPA facade and leave the > OpenJPA kernel's default in place for other facades. > > The value may be overridden by adding the following property to > persistence.xml > > /> > > -- > This message is automatically generated by JIRA. > - > If you think it was sent incorrectly contact one of the administrators: > http://issues.apache.org/jira/secure/Administrators.jspa > - > For more information on JIRA, see: http://www.atlassian.com/software/jira > > > -- -Michael Dick ------=_Part_95730_20236536.1155676841818--