You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by jr...@apache.org on 2009/05/11 23:59:21 UTC
svn commit: r773704 [4/4] - in /openjpa/trunk:
openjpa-kernel/src/main/java/org/apache/openjpa/enhance/
openjpa-kernel/src/main/java/org/apache/openjpa/meta/
openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/
openjpa-persiste...
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperFieldEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperFieldEntity.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperFieldEntity.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperFieldEntity.java Mon May 11 21:59:15 2009
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.access.xml;
+
+public class XMLSuperFieldEntity {
+
+ private int id;
+
+ private String name;
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj instanceof XMLSuperFieldEntity) {
+ XMLSuperFieldEntity sfe = (XMLSuperFieldEntity)obj;
+ return id == sfe.getId() &&
+ name.equals(sfe.getName());
+ }
+ return false;
+ }
+}
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperFieldEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperPropertyEntity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperPropertyEntity.java?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperPropertyEntity.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperPropertyEntity.java Mon May 11 21:59:15 2009
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.access.xml;
+
+public class XMLSuperPropertyEntity {
+
+ private int id;
+
+ private String name;
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj instanceof XMLSuperPropertyEntity) {
+ XMLSuperPropertyEntity sfe = (XMLSuperPropertyEntity)obj;
+ return getId() == sfe.getId() &&
+ getName().equals(sfe.getName());
+ }
+ return false;
+ }
+}
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/XMLSuperPropertyEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java?rev=773704&r1=773703&r2=773704&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java Mon May 11 21:59:15 2009
@@ -413,6 +413,17 @@
}
}
+ /**
+ * Asserts that the given targetType is assignable from given actual
+ * Throwable and that the exception message contains the specified message
+ * or message fragments.
+ */
+ protected void assertExceptionMessage(final Throwable actual,
+ Class targetType, String...messages) {
+ assertException(actual, targetType, null);
+ assertMessage(actual, messages);
+ }
+
/**
* Assert that each of given keys are present in the message of the given
* Throwable.
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-field-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-field-orm.xml?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-field-orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-field-orm.xml Mon May 11 21:59:15 2009
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
+ version="2.0">
+ <access>FIELD</access>
+ <entity name="XMLFieldAccess2"
+ class="org.apache.openjpa.persistence.access.xml.XMLFieldAccess">
+ <named-query name="XMLFieldAccess2.query">
+ <query>SELECT xfa FROM XMLFieldAccess2 xfa WHERE
+ xfa.id = :id AND xfa.strField = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="strField"/>
+ <version name="version"/>
+ </attributes>
+ </entity>
+ <entity name="XMLDFMPA2"
+ class=
+ "org.apache.openjpa.persistence.access.xml.XMLDefFieldMixedPropAccess">
+ <named-query name="XMLDFMPA2.query">
+ <query>SELECT df FROM XMLDFMPA2 df WHERE
+ df.id = :id AND df.stringField = :strVal
+ </query>
+ </named-query>
+ <named-query name="XMLDFMPA2.badQuery">
+ <query>SELECT p FROM XMLDFMPA2 p WHERE
+ p.id = :id AND p.strField = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="stringField" access="PROPERTY"/>
+ <version name="version"/>
+ <transient name="strField"/>
+ </attributes>
+ </entity>
+</entity-mappings>
\ No newline at end of file
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-field-orm.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-persistence.xml?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-persistence.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-persistence.xml Mon May 11 21:59:15 2009
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<persistence
+ xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
+ http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0" >
+ <persistence-unit name="Access-EMPropDef" transaction-type="RESOURCE_LOCAL">
+ <description>PU for access testing</description>
+ <provider>
+ org.apache.openjpa.persistence.PersistenceProviderImpl
+ </provider>
+ <mapping-file>
+ org/apache/openjpa/persistence/access/access-def-prop-orm.xml
+ </mapping-file>
+ <class>org.apache.openjpa.persistence.access.xml.XMLPropAccess</class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLDefPropMixedFieldAccess
+ </class>
+ <properties>
+ <property name="openjpa.jdbc.SynchronizeMappings"
+ value="buildSchema"/>
+ </properties>
+ </persistence-unit>
+
+ <persistence-unit name="Access-EMFldDef" transaction-type="RESOURCE_LOCAL">
+ <description>PU for access testing</description>
+ <provider>
+ org.apache.openjpa.persistence.PersistenceProviderImpl
+ </provider>
+ <mapping-file>
+ org/apache/openjpa/persistence/access/access-def-field-orm.xml
+ </mapping-file>
+ <class>org.apache.openjpa.persistence.access.xml.XMLFieldAccess</class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLDefFieldMixedPropAccess
+ </class>
+ <properties>
+ <property name="openjpa.jdbc.SynchronizeMappings"
+ value="buildSchema"/>
+ </properties>
+ </persistence-unit>
+</persistence>
\ No newline at end of file
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-persistence.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-prop-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-prop-orm.xml?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-prop-orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-prop-orm.xml Mon May 11 21:59:15 2009
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
+ version="2.0">
+ <access>PROPERTY</access>
+ <entity name="XMLDPMFA2"
+ class=
+ "org.apache.openjpa.persistence.access.xml.XMLDefPropMixedFieldAccess">
+ <named-query name="XMLDPMFA2.query">
+ <query>SELECT dp FROM XMLDPMFA2 dp WHERE
+ dp.id = :id AND dp.strField = :strVal
+ </query>
+ </named-query>
+ <named-query name="XMLDPMFA2.badQuery">
+ <query>SELECT p FROM XMLDPMFA2 p WHERE
+ p.id = :id AND p.strProp = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="strField" access="FIELD"/>
+ <version name="version"/>
+ <transient name="strProp"/>
+ </attributes>
+ </entity>
+ <entity name="XMLPropAccess2"
+ class="org.apache.openjpa.persistence.access.xml.XMLPropAccess">
+ <named-query name="XMLPropAccess2.query">
+ <query>SELECT xpa FROM XMLPropAccess2 xpa WHERE
+ xpa.id = :id AND xpa.strProp = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="strProp"/>
+ <version name="version"/>
+ </attributes>
+ </entity>
+</entity-mappings>
\ No newline at end of file
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-def-prop-orm.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-orm.xml?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-orm.xml Mon May 11 21:59:15 2009
@@ -0,0 +1,441 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
+ version="2.0">
+ <mapped-superclass
+ class=
+ "org.apache.openjpa.persistence.access.xml.XMLAbstractMappedSuperField"
+ access="FIELD">
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="name" access="FIELD"/>
+ </attributes>
+ </mapped-superclass>
+ <mapped-superclass
+ class=
+ "org.apache.openjpa.persistence.access.xml.XMLAbstractMappedSuperProperty"
+ access="PROPERTY">
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="name" access="PROPERTY"/>
+ <transient name="createDate"/>
+ </attributes>
+ </mapped-superclass>
+ <mapped-superclass
+ class="org.apache.openjpa.persistence.access.xml.XMLMappedSuperField"
+ access="FIELD">
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="name" access="FIELD"/>
+ <transient name="crtDate"/>
+ </attributes>
+ </mapped-superclass>
+ <mapped-superclass
+ class="org.apache.openjpa.persistence.access.xml.XMLMappedSuperProperty"
+ access="PROPERTY">
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="name" access="PROPERTY"/>
+ </attributes>
+ </mapped-superclass>
+ <mapped-superclass
+ class="org.apache.openjpa.persistence.access.xml.XMLMixedMappedSuper"
+ access="PROPERTY">
+ <attributes>
+ <id name="mid" access="FIELD">
+ <generated-value/>
+ </id>
+ <basic name="name" access="PROPERTY"/>
+ <transient name="id"/>
+ </attributes>
+ </mapped-superclass>
+
+ <entity name="XMLFieldAccess"
+ class="org.apache.openjpa.persistence.access.xml.XMLFieldAccess"
+ access="FIELD">
+ <named-query name="XMLFieldAccess.query">
+ <query>SELECT xfa FROM XMLFieldAccess xfa WHERE
+ xfa.id = :id AND xfa.strField = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="strField"/>
+ <version name="version"/>
+ </attributes>
+ </entity>
+ <entity name="XMLPropAccess"
+ class="org.apache.openjpa.persistence.access.xml.XMLPropAccess"
+ access="PROPERTY">
+ <named-query name="XMLPropAccess.query">
+ <query>SELECT xpa FROM XMLPropAccess xpa WHERE
+ xpa.id = :id AND xpa.strProp = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="strProp"/>
+ <version name="version"/>
+ </attributes>
+ </entity>
+ <entity name="XMLDFMPA"
+ class=
+ "org.apache.openjpa.persistence.access.xml.XMLDefFieldMixedPropAccess"
+ access="FIELD">
+ <named-query name="XMLDFMPA.query">
+ <query>SELECT df FROM XMLDFMPA df WHERE
+ df.id = :id AND df.stringField = :strVal
+ </query>
+ </named-query>
+ <named-query name="XMLDFMPA.badQuery">
+ <query>SELECT p FROM XMLDFMPA p WHERE
+ p.id = :id AND p.strField = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="stringField" access="PROPERTY"/>
+ <version name="version"/>
+ <transient name="strField"/>
+ </attributes>
+ </entity>
+ <entity name="XMLDPMFA"
+ class=
+ "org.apache.openjpa.persistence.access.xml.XMLDefPropMixedFieldAccess"
+ access="PROPERTY">
+ <named-query name="XMLDPMFA.query">
+ <query>SELECT dp FROM XMLDPMFA dp WHERE
+ dp.id = :id AND dp.strField = :strVal
+ </query>
+ </named-query>
+ <named-query name="XMLDPMFA.badQuery">
+ <query>SELECT p FROM XMLDPMFA p WHERE
+ p.id = :id AND p.strProp = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="strField" access="FIELD"/>
+ <version name="version"/>
+ <transient name="strProp"/>
+ </attributes>
+ </entity>
+
+ <entity name="XMLPropertySub"
+ class="org.apache.openjpa.persistence.access.xml.XMLPropertySub"
+ access="PROPERTY">
+ <named-query name="XMLPropertySub.query">
+ <query>SELECT ps FROM XMLPropertySub ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
+ </query>
+ </named-query>
+ <named-query name="XMLPropertySub.badQuery">
+ <query>SELECT ps FROM XMLPropertySub ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
+ </query>
+ </named-query>
+ <attributes>
+ <basic name="createDate">
+ <temporal>TIMESTAMP</temporal>
+ </basic>
+ </attributes>
+ </entity>
+ <entity name="XMLFieldSub"
+ class="org.apache.openjpa.persistence.access.xml.XMLFieldSub"
+ access="FIELD">
+ <named-query name="XMLFieldSub.query">
+ <query>SELECT fs FROM XMLFieldSub fs WHERE
+ fs.id = :id AND fs.name = :name AND fs.crtDate = :crtDate
+ </query>
+ </named-query>
+ <named-query name="XMLFieldSub.badQuery">
+ <query>SELECT fs FROM XMLFieldSub fs WHERE
+ fs.id = :id AND fs.name = :name AND fs.createDate = :crtDate
+ </query>
+ </named-query>
+ <attributes>
+ <basic name="crtDate">
+ <temporal>TIMESTAMP</temporal>
+ </basic>
+ </attributes>
+ </entity>
+ <entity name="XMLPropertySub2"
+ class="org.apache.openjpa.persistence.access.xml.XMLPropertySub2"
+ access="PROPERTY">
+ <named-query name="XMLPropertySub2.query">
+ <query>SELECT ps FROM XMLPropertySub2 ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
+ </query>
+ </named-query>
+ <named-query name="XMLPropertySub2.badQuery">
+ <query>SELECT ps FROM XMLPropertySub2 ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
+ </query>
+ </named-query>
+ <attributes>
+ <basic name="createDate">
+ <temporal>TIMESTAMP</temporal>
+ </basic>
+ </attributes>
+ </entity>
+ <entity name="XMLFieldSub2"
+ class="org.apache.openjpa.persistence.access.xml.XMLFieldSub2"
+ access="FIELD">
+ <named-query name="XMLFieldSub2.query">
+ <query>SELECT ps FROM XMLFieldSub2 ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
+ </query>
+ </named-query>
+ <named-query name="XMLFieldSub2.badQuery">
+ <query>SELECT ps FROM XMLFieldSub2 ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
+ </query>
+ </named-query>
+ <attributes>
+ <basic name="crtDate">
+ <temporal>TIMESTAMP</temporal>
+ </basic>
+ </attributes>
+ </entity>
+ <entity name="XMLMixedFieldSub"
+ class="org.apache.openjpa.persistence.access.xml.XMLMixedFieldSub"
+ access="FIELD">
+ <named-query name="XMLMixedFieldSub.query">
+ <query>SELECT fs FROM XMLMixedFieldSub fs WHERE
+ fs.mid = :id AND fs.name = :name AND fs.createDate = :crtDate
+ AND fs.myField = :myField
+ </query>
+ </named-query>
+ <named-query name="XMLMixedFieldSub.badQuery">
+ <query>SELECT fs FROM XMLMixedFieldSub fs WHERE
+ fs.mid = :id AND fs.name = :name AND fs.myFieldProp = :myField
+ </query>
+ </named-query>
+ <attributes>
+ <basic name="myField"/>
+ <basic name="createDate" access="PROPERTY">
+ <temporal>TIMESTAMP</temporal>
+ </basic>
+ <transient name="crtDate"/>
+ </attributes>
+ </entity>
+ <entity name="XMLSuperPropertyEntity"
+ class="org.apache.openjpa.persistence.access.xml.XMLSuperPropertyEntity"
+ access="PROPERTY">
+ <inheritance/>
+ <named-query name="XMLSuperPropertyEntity.query">
+ <query>SELECT sfe FROM XMLSuperPropertyEntity sfe WHERE
+ sfe.id = :id AND sfe.name = :name
+ </query>
+ </named-query>
+ <named-query name="XMLSuperPropertyEntity.badQuery">
+ <query>SELECT sfe FROM XMLSuperPropertyEntity sfe WHERE
+ sfe.id = :id AND sfe.name = :name AND sfe.crtDate = :crtDate
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="name" access="PROPERTY"/>
+ </attributes>
+ </entity>
+ <entity name="XMLFieldSub3"
+ class="org.apache.openjpa.persistence.access.xml.XMLFieldSub3"
+ access="FIELD">
+ <inheritance/>
+ <named-query name="XMLFieldSub3.query">
+ <query>SELECT ps FROM XMLFieldSub3 ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
+ </query>
+ </named-query>
+ <named-query name="XMLFieldSub3.badQuery">
+ <query>SELECT ps FROM XMLFieldSub3 ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
+ </query>
+ </named-query>
+ <attributes>
+ <basic name="crtDate">
+ <temporal>TIMESTAMP</temporal>
+ </basic>
+ </attributes>
+ </entity>
+ <entity name="XMLSuperFieldEntity"
+ class="org.apache.openjpa.persistence.access.xml.XMLSuperFieldEntity"
+ access="FIELD">
+ <inheritance/>
+ <named-query name="XMLSuperFieldEntity.query">
+ <query>SELECT sfe FROM XMLSuperFieldEntity sfe WHERE
+ sfe.id = :id AND sfe.name = :name
+ </query>
+ </named-query>
+ <named-query name="XMLSuperFieldEntity.badQuery">
+ <query>SELECT sfe FROM XMLSuperFieldEntity sfe WHERE
+ sfe.id = :id AND sfe.name = :name AND sfe.crtDate = :crtDate
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id" access="FIELD">
+ <generated-value/>
+ </id>
+ <basic name="name"/>
+ </attributes>
+ </entity>
+ <entity name="XMLPropertySub3"
+ class="org.apache.openjpa.persistence.access.xml.XMLPropertySub3"
+ access="PROPERTY">
+ <inheritance/>
+ <named-query name="XMLPropertySub3.query">
+ <query>SELECT ps FROM XMLPropertySub3 ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.createDate = :crtDate
+ </query>
+ </named-query>
+ <named-query name="XMLPropertySub3.badQuery">
+ <query>SELECT ps FROM XMLPropertySub3 ps WHERE
+ ps.id = :id AND ps.name = :name AND ps.crtDate = :crtDate
+ </query>
+ </named-query>
+ <attributes>
+ <basic name="createDate">
+ <temporal>TIMESTAMP</temporal>
+ </basic>
+ </attributes>
+ </entity>
+ <entity name="XMLPropEmbedEntity"
+ class="org.apache.openjpa.persistence.access.xml.XMLPropEmbedEntity"
+ access="PROPERTY">
+ <named-query name="XMLPropEmbedEntity.query">
+ <query>SELECT fs FROM XMLPropEmbedEntity fs WHERE
+ fs.id = :id AND fs.name = :name AND fs.embedProp.fName = :firstName
+ AND fs.embedProp.lName = :lastName
+ </query>
+ </named-query>
+ <named-query name="XMLPropEmbedEntity.badQuery">
+ <query>SELECT fs FROM XMLPropEmbedEntity fs WHERE
+ fs.id = :id AND fs.name = :name AND fs.embedProp.firstName =
+ :firstName AND fs.embedProp.lastName = :lastName
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id" access="FIELD">
+ <generated-value/>
+ </id>
+ <basic name="name"/>
+ <embedded name="embedProp"/>
+ </attributes>
+ </entity>
+ <entity name="XMLFieldEmbedEntity"
+ class="org.apache.openjpa.persistence.access.xml.XMLFieldEmbedEntity"
+ access="FIELD">
+ <named-query name="XMLFieldEmbedEntity.query">
+ <query>SELECT fs FROM XMLFieldEmbedEntity fs WHERE
+ fs.id = :id AND fs.name = :name AND fs.epa.firstName = :firstName
+ AND fs.epa.lastName = :lastName
+ </query>
+ </named-query>
+ <named-query name="XMLFieldEmbedEntity.badQuery">
+ <query>SELECT fs FROM XMLFieldEmbedEntity fs WHERE
+ fs.id = :id AND fs.name = :name AND fs.epa.fName = :firstName
+ AND fs.epa.lName = :lastName
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="name"/>
+ <embedded name="epa" access="FIELD"/>
+ </attributes>
+ </entity>
+ <entity name="XMLPropMixedEntity"
+ class="org.apache.openjpa.persistence.access.xml.XMLPropMixedEntity"
+ access="PROPERTY">
+ <named-query name="XMLPropMixedEntity.query">
+ <query>SELECT fs FROM XMLPropMixedEntity fs WHERE
+ fs.idval = :id AND fs.name = :name AND
+ fs.ema.firstName = :firstName
+ AND fs.ema.lastName = :lastName AND
+ fs.ema.mName = :middleName
+ </query>
+ </named-query>
+ <named-query name="XMLPropMixedEntity.badQuery">
+ <query>SELECT fs FROM XMLPropMixedEntity fs WHERE
+ fs.idval = :id AND fs.name = :name AND
+ fs.ema.firstName = :firstName AND
+ fs.ema.lastName = :lastName AND
+ fs.ema.middleName = :middleName
+ </query>
+ </named-query>
+ <attributes>
+ <id name="idval" access="FIELD">
+ <generated-value/>
+ </id>
+ <basic name="name"/>
+ <embedded name="ema" access="FIELD"/>
+ <transient name="id"/>
+ <transient name="embedProp"/>
+ </attributes>
+ </entity>
+
+ <embeddable
+ class="org.apache.openjpa.persistence.access.xml.XMLEmbedFieldAccess"
+ access="FIELD">
+ <attributes>
+ <basic name="fName"/>
+ <basic name="lName"/>
+ </attributes>
+ </embeddable>
+ <embeddable
+ class="org.apache.openjpa.persistence.access.xml.XMLEmbedPropAccess"
+ access="PROPERTY">
+ <attributes>
+ <basic name="firstName"/>
+ <basic name="lastName"/>
+ </attributes>
+ </embeddable>
+ <embeddable
+ class="org.apache.openjpa.persistence.access.xml.XMLEmbedMixedAccess"
+ access="PROPERTY">
+ <attributes>
+ <basic name="mName" access="FIELD"/>
+ <basic name="firstName"/>
+ <basic name="lastName"/>
+ <transient name="middleName"/>
+ </attributes>
+ </embeddable>
+ </entity-mappings>
\ No newline at end of file
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-orm.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-persistence.xml?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-persistence.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-persistence.xml Mon May 11 21:59:15 2009
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<persistence
+ xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
+ http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0" >
+ <persistence-unit name="Access-1" transaction-type="RESOURCE_LOCAL">
+ <description>PU for access testing</description>
+ <provider>
+ org.apache.openjpa.persistence.PersistenceProviderImpl
+ </provider>
+ <mapping-file>
+ org/apache/openjpa/persistence/access/access-orm.xml
+ </mapping-file>
+ <class>org.apache.openjpa.persistence.access.xml.XMLFieldAccess</class>
+ <class>org.apache.openjpa.persistence.access.xml.XMLPropAccess</class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLDefFieldMixedPropAccess
+ </class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLDefPropMixedFieldAccess
+ </class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLPropEmbedEntity
+ </class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLEmbedFieldAccess
+ </class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLFieldEmbedEntity
+ </class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLEmbedPropAccess
+ </class>
+ <properties>
+ <property name="openjpa.jdbc.SynchronizeMappings"
+ value="buildSchema"/>
+ </properties>
+ </persistence-unit>
+</persistence>
\ No newline at end of file
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-persistence.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-field-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-field-orm.xml?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-field-orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-field-orm.xml Mon May 11 21:59:15 2009
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
+ version="2.0">
+ <persistence-unit-metadata>
+ <persistence-unit-defaults>
+ <access>FIELD</access>
+ </persistence-unit-defaults>
+ </persistence-unit-metadata>
+ <entity name="XMLFieldAccess2"
+ class="org.apache.openjpa.persistence.access.xml.XMLFieldAccess">
+ <named-query name="XMLFieldAccess2.query">
+ <query>SELECT xfa FROM XMLFieldAccess2 xfa WHERE
+ xfa.id = :id AND xfa.strField = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="strField"/>
+ <version name="version"/>
+ </attributes>
+ </entity>
+ <entity name="XMLDFMPA2"
+ class=
+ "org.apache.openjpa.persistence.access.xml.XMLDefFieldMixedPropAccess">
+ <named-query name="XMLDFMPA2.query">
+ <query>SELECT df FROM XMLDFMPA2 df WHERE
+ df.id = :id AND df.stringField = :strVal
+ </query>
+ </named-query>
+ <named-query name="XMLDFMPA2.badQuery">
+ <query>SELECT p FROM XMLDFMPA2 p WHERE
+ p.id = :id AND p.strField = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="stringField" access="PROPERTY"/>
+ <version name="version"/>
+ <transient name="strField"/>
+ </attributes>
+ </entity>
+</entity-mappings>
\ No newline at end of file
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-field-orm.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-persistence.xml?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-persistence.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-persistence.xml Mon May 11 21:59:15 2009
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<persistence
+ xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
+ http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0" >
+ <persistence-unit name="Access-PUPropDef" transaction-type="RESOURCE_LOCAL">
+ <description>PU for access testing</description>
+ <provider>
+ org.apache.openjpa.persistence.PersistenceProviderImpl
+ </provider>
+ <mapping-file>
+ org/apache/openjpa/persistence/access/access-pudef-prop-orm.xml
+ </mapping-file>
+ <class>org.apache.openjpa.persistence.access.xml.XMLPropAccess</class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLDefPropMixedFieldAccess
+ </class>
+ <properties>
+ <property name="openjpa.jdbc.SynchronizeMappings"
+ value="buildSchema"/>
+ </properties>
+ </persistence-unit>
+
+ <persistence-unit name="Access-PUFldDef" transaction-type="RESOURCE_LOCAL">
+ <description>PU for access testing</description>
+ <provider>
+ org.apache.openjpa.persistence.PersistenceProviderImpl
+ </provider>
+ <mapping-file>
+ org/apache/openjpa/persistence/access/access-pudef-field-orm.xml
+ </mapping-file>
+ <class>org.apache.openjpa.persistence.access.xml.XMLFieldAccess</class>
+ <class>
+ org.apache.openjpa.persistence.access.xml.XMLDefFieldMixedPropAccess
+ </class>
+ <properties>
+ <property name="openjpa.jdbc.SynchronizeMappings"
+ value="buildSchema"/>
+ </properties>
+ </persistence-unit>
+</persistence>
\ No newline at end of file
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-persistence.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-prop-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-prop-orm.xml?rev=773704&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-prop-orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-prop-orm.xml Mon May 11 21:59:15 2009
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
+ version="2.0">
+ <persistence-unit-metadata>
+ <persistence-unit-defaults>
+ <access>PROPERTY</access>
+ </persistence-unit-defaults>
+ </persistence-unit-metadata>
+ <entity name="XMLDPMFA2"
+ class=
+ "org.apache.openjpa.persistence.access.xml.XMLDefPropMixedFieldAccess">
+ <named-query name="XMLDPMFA2.query">
+ <query>SELECT dp FROM XMLDPMFA2 dp WHERE
+ dp.id = :id AND dp.strField = :strVal
+ </query>
+ </named-query>
+ <named-query name="XMLDPMFA2.badQuery">
+ <query>SELECT p FROM XMLDPMFA2 p WHERE
+ p.id = :id AND p.strProp = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="strField" access="FIELD"/>
+ <version name="version"/>
+ <transient name="strProp"/>
+ </attributes>
+ </entity>
+ <entity name="XMLPropAccess2"
+ class="org.apache.openjpa.persistence.access.xml.XMLPropAccess">
+ <named-query name="XMLPropAccess2.query">
+ <query>SELECT xpa FROM XMLPropAccess2 xpa WHERE
+ xpa.id = :id AND xpa.strProp = :strVal
+ </query>
+ </named-query>
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ <basic name="strProp"/>
+ <version name="version"/>
+ </attributes>
+ </entity>
+</entity-mappings>
\ No newline at end of file
Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/access/access-pudef-prop-orm.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java?rev=773704&r1=773703&r2=773704&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java Mon May 11 21:59:15 2009
@@ -744,7 +744,7 @@
public boolean includes(AnnotatedElement obj) {
Access access = obj.getAnnotation(Access.class);
- return access != null && access.equals(target);
+ return access != null && access.value().equals(target);
}
}
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java?rev=773704&r1=773703&r2=773704&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java Mon May 11 21:59:15 2009
@@ -843,8 +843,14 @@
return false;
}
+ int access = AccessCode.UNKNOWN;
if (meta == null) {
int accessCode = toAccessType(attrs.getValue("access"));
+ // if access not specified and access was specified at
+ // the system level, use the system default (which may
+ // be UNKNOWN)
+ if (accessCode == AccessCode.UNKNOWN)
+ accessCode = _access;
meta = repos.addMetaData(_cls, accessCode);
meta.setEnvClassLoader(_envLoader);
meta.setSourceMode(MODE_NONE);
@@ -853,7 +859,8 @@
if (_parser != null)
_parser.parse(_cls);
}
-
+ access = meta.getAccessType();
+
boolean mappedSuper = "mapped-superclass".equals(elem);
boolean embeddable = "embeddable".equals(elem);
if (isMetaDataMode()) {
@@ -872,7 +879,7 @@
meta.setEmbeddedOnly(mappedSuper || embeddable);
if (embeddable) {
- addDeferredEmbeddableMetaData(_cls);
+ addDeferredEmbeddableMetaData(_cls, access);
}
}
if (isMappingMode())
@@ -935,7 +942,6 @@
return AccessCode.EXPLICIT | AccessCode.PROPERTY;
return AccessCode.EXPLICIT | AccessCode.FIELD;
}
-
/**
* Parse flush-mode element.
*/
@@ -1882,16 +1888,17 @@
* @param embedType embeddable class
* @param access class level access for embeddable
*/
- protected void addDeferredEmbeddableMetaData(Class<?> embedType) {
+ protected void addDeferredEmbeddableMetaData(Class<?> embedType,
+ int access) {
ArrayList<MetaDataContext> fmds = _embeddables.get(embedType);
if (fmds != null && fmds.size() > 0) {
for (int i = fmds.size() -1 ; i >= 0; i--) {
MetaDataContext md = fmds.get(i);
if (md instanceof FieldMetaData) {
- ((FieldMetaData)md).addEmbeddedMetaData();
+ ((FieldMetaData)md).addEmbeddedMetaData(access);
}
else if (md instanceof ValueMetaData) {
- ((ValueMetaData)md).addEmbeddedMetaData();
+ ((ValueMetaData)md).addEmbeddedMetaData(access);
}
fmds.remove(i);
}