Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 54906 invoked from network); 25 Jan 2007 17:26:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jan 2007 17:26:13 -0000 Received: (qmail 7882 invoked by uid 500); 25 Jan 2007 17:26:19 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 7777 invoked by uid 500); 25 Jan 2007 17:26:19 -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 7768 invoked by uid 99); 25 Jan 2007 17:26:18 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 09:26:18 -0800 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=HTML_MESSAGE,MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of allee8285@gmail.com designates 64.233.162.234 as permitted sender) Received: from [64.233.162.234] (HELO nz-out-0506.google.com) (64.233.162.234) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 09:26:10 -0800 Received: by nz-out-0506.google.com with SMTP id j2so439429nzf for ; Thu, 25 Jan 2007 09:25:50 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=EE/q67llgeaod7VD16ystE3cvMQMPNvJGQS814GcEgr0o90Sp09RJjjzMwac/jTXqVNEd4w20T8phVCRPPqPYFdz2aR8srZqQPALeM9d70OAOj5JwDR6vZCl8a3q7OKQ51bEJ4B1QJy07yDdsi+aVm8fOOQ9lLxLm6MCeFgRB3Y= Received: by 10.65.112.5 with SMTP id p5mr3327480qbm.1169745949786; Thu, 25 Jan 2007 09:25:49 -0800 (PST) Received: by 10.65.151.16 with HTTP; Thu, 25 Jan 2007 09:25:49 -0800 (PST) Message-ID: <8e68c8e90701250925p2adb16b9l440af12276f6fec@mail.gmail.com> Date: Thu, 25 Jan 2007 11:25:49 -0600 From: "Albert Lee" To: open-jpa-dev@incubator.apache.org Subject: Re: Using query hints for mapping extensions in orm.xml In-Reply-To: <7D856CDFE035FF45A0420ACBD71BDD6302F7123D@repbex02.amer.bea.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_23300_21895784.1169745949687" References: <7D856CDFE035FF45A0420ACBD71BDD6302DB0EE3@repbex02.amer.bea.com> <89c0c52c0701160612t70edc563m777b94d278a4aa44@mail.gmail.com> <82B77D6C-736F-4200-A500-6E60849C5280@apache.org> <89c0c52c0701180616q1dbd07c9rc18edb1aa77e6aa7@mail.gmail.com> <060A7895-CBBF-420B-B8BB-28E6B9E1B544@SUN.com> <8e68c8e90701230855s64d50debmae7dcb22e63c7095@mail.gmail.com> <89c0c52c0701240730q1ba554e2kc4439ef6abb2790b@mail.gmail.com> <8e68c8e90701240838i6cc48b4fh288a46c53078efeb@mail.gmail.com> <7D856CDFE035FF45A0420ACBD71BDD6302F7123D@repbex02.amer.bea.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_23300_21895784.1169745949687 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Let's put this into a more concrete terms: Given: 1) Existing JPA orm schema in http://java.sun.com/xml/ns/persistence/orm_1_0.xsd 2) OpenJPA supports its version of the orm schema in http://incubator.apache.org/openjpa/xml/ns/persistence/openjpa_orm_1_0.xsd Note: we need to find a more permanent home for this schema other than putting it in incubator.apache.org. Suggestions? 3) xml name space for both schema are: xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:openjpa="http://java.sun.com/xml/ns/persistence/orm" Note: Both schema MUST be in the same name space due to schma redefine restriction. Use cases: 1) application specifies orm_1_0.xsd in the orm.xml - portable to other providers - no openjpa specific functions allow. 2) application specifies openjpa_orm_1_0.xsd in orm.xml - only "guarantee" to work with openjpa provider. - openjpa functions must be specified according to openjpa orm additional schema. - Can use the combination of persistence.xml and orm.xml stanza to enforce the orm must be applied using openjpa provider. persistence.xml org.apache.openjpa.persistence.PersistenceProviderImpl META-INF/openjpa_orm.xml ...... openjpa_orm.xml ........ 3) No schema is specified in the orm.xml (least desirable option) - openjpa functions may be added to orm.xml. OpenJPA tolerates this option - There is no validation on the stanza, hence may be problematic in processing/handling of the stanza. - No guarantee this will work in other providers. - But this option is the least restrictive in orm usage All three options are available for use by an application, in order of compliance and portability preferences. Albert Lee. On 1/24/07, Patrick Linskey wrote: > > Firstly, thanks for putting this together. > > I don't think that portability is a huge problem. I agree with the three > scenarios that Albert mentioned, but I think that we can refine #1: > > > 1) if an application wants to be fully portable between providers, the > > standard orm.xsd must be specified. This will inhibit the use > > of openjpa > > features. > > I would revise this as follows: > > 1) if an application wants to be fully portable between providers, the > standard orm.xsd must be specified. This will inhibit the use of OpenJPA > features in that file, so a parallel openjpa-orm.xml file must be used > which conforms to the OpenJPA XSD and adds the additional information. > > We could even create a second XSD for that situation that allows only > OpenJPA content to help prevent people from putting conflicting stanzas > in the two files. > > -Patrick > > -- > Patrick Linskey > BEA Systems, Inc. > > _______________________________________________________________________ > 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. > > > -----Original Message----- > > From: Albert Lee [mailto:allee8285@gmail.com] > > Sent: Wednesday, January 24, 2007 8:38 AM > > To: open-jpa-dev@incubator.apache.org > > Subject: Re: Using query hints for mapping extensions in orm.xml > > > > First, I would not expected other providers will handle the special > > openjpa.orm.xsd even if it is spec'ed out in the document > > header. If they > > choose to ignore the new schema and proceed to parse the > > document content > > using the standard orm.xsd, then any openjpa specific stanza > > will probably > > be flagged as non-compliance. > > > > The other scenario is: what about if the document does not specify the > > schema at all, like the original sample. I suspect most providers will > > tolerate this scenario, just like openjpa does. > > > > Can the solutions be: > > 1) if an application wants to be fully portable between providers, the > > standard orm.xsd must be specified. This will inhibit the use > > of openjpa > > features. > > 2) if an application wants to use openjpa specific stanza and > > still be used > > by other provider, don't specify the schema at all in the > > document. Hoping > > the other providers will tolerate and ignore the openjpa features. > > 3) if an application wants to be openjpa schema compliance, then use > > openjpa.orm.xsd in the document header and openjpa can validate the > > document. However this will prevent the application to be > > portable to other > > providers. > > > > Albert Lee. > > > > > > On 1/24/07, Kevin Sutter wrote: > > > > > > Thank you, Albert, for your experimentation. The updated schema > > > definition > > > (openjpa_orm_1_0.xsd) and the example openjpa_orm.xml seems > > to be what we > > > are looking for. I guess the only concern is whether we > > can count on > > > other > > > JPA implementations to ignore this extra schema definition > > and just rely > > > on > > > the standard orm.xsd. > > > > > > Question: Even if other JPA providers are smart enough to > > ignore our > > > specialized schema and use the standard JPA schema, what > > happens to our > > > extension elements? Do they get ignored as well? Or, will the > > > verification > > > step still trip over these new/updated elements? > > > > > > Thanks again, > > > Kevin > > > > > > > > > On 1/23/07, Albert Lee wrote: > > > > > > > > Somehow the one of the attachment (openjpa_orm_1_0.xsd) > > from my previous > > > > note did not make it to this forum. > > > > > > > > Try again here. > > > > > > > > > -------------------------------------------------------------- > > -------------------------------- > > > > > > > > > > > > > > > > > > > version="1.0" > > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > > targetNamespace=" > > http://java.sun.com/xml/ns/persistence/orm" > > > > > > xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" > > > > elementFormDefault="qualified" > > > > attributeFormDefault="unqualified" > > > > > > > > > > > > > > > > > > > > > @(#)openjpa_orm_1_0.xsd 1.0 Jan 22 2007 > > > > > > > > > > > > > > > > > > > > > > > This is the XML Schema for extending the persistence > > > > object-relational > > > > mapping file for OpenJPA specific features. > > > > > > > > The file may be named "META-INF/orm.xml" in the persistence > > > > archive or it may be named some other name which would be > > > > used to locate the file as resource on the classpath. > > > > > > > > ]]> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > minOccurs="0" maxOccurs="1" default="false"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > type="xsd:boolean" > > > > minOccurs="0" maxOccurs="1" default="false"/> > > > > > > > > > minOccurs="0" > > > > maxOccurs="1" default="parallel"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Albert Lee > > > > > > > > > > > > > ------=_Part_23300_21895784.1169745949687--