mirror of
https://github.com/apache/openjpa.git
synced 2025-02-21 01:15:30 +00:00
OPENJPA-859: Restructured testcase. Minor formatting change.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@828242 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
721c6ce211
commit
7a46717616
@ -18,20 +18,17 @@
|
||||
*/
|
||||
package org.apache.openjpa.persistence;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
import org.apache.openjpa.persistence.entity.MixedMappingLocation;
|
||||
import org.apache.openjpa.persistence.entity.MixedMappingLocationEmbeddedId;
|
||||
import org.apache.openjpa.persistence.test.SingleEMFTestCase;
|
||||
|
||||
// org.apache.openjpa.persistence.TestMixedMappingLocation
|
||||
@Entity
|
||||
public class TestMixedMappingLocation extends SingleEMFTestCase {
|
||||
|
||||
@Override
|
||||
protected String getPersistenceUnitName() {
|
||||
return "test_parsing";
|
||||
return "xml-persistence-unit";
|
||||
}
|
||||
|
||||
public void setUp() {
|
||||
setUp(DROP_TABLES,MixedMappingLocationEmbeddedId.class, MixedMappingLocation.class);
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ public class MixedMappingLocationEmbeddedId implements Serializable {
|
||||
@Basic
|
||||
private String country;
|
||||
|
||||
private String basic10;
|
||||
|
||||
public MixedMappingLocationEmbeddedId() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
version="1.0">
|
||||
|
||||
<persistence-unit name="xml-persistence-unit">
|
||||
<description>
|
||||
This needs to be listed because the OpenJPA test framework
|
||||
@ -53,6 +52,7 @@
|
||||
<mapping-file>org/apache/openjpa/persistence/embed/embed-assoc-over-orm.xml</mapping-file>
|
||||
<mapping-file>org/apache/openjpa/persistence/detach/detach-orm.xml</mapping-file>
|
||||
<mapping-file>org/apache/openjpa/persistence/enhance/identity/mapsId-orm.xml</mapping-file>
|
||||
<mapping-file>org/apache/openjpa/persistence/entity/orm.xml</mapping-file>
|
||||
<properties>
|
||||
<property name="openjpa.jdbc.SynchronizeMappings"
|
||||
value="buildSchema(ForeignKeys=true)"/>
|
||||
@ -256,12 +256,6 @@
|
||||
<class>org.apache.openjpa.persistence.meta.MdrTestEntity</class>
|
||||
</persistence-unit>
|
||||
|
||||
<persistence-unit name="test_parsing">
|
||||
<mapping-file>org/apache/openjpa/persistence/entity/orm.xml</mapping-file>
|
||||
<class>org.apache.openjpa.persistence.entity.MixedMappingLocation</class>
|
||||
<class>org.apache.openjpa.persistence.entity.MixedMappingLocationEmbeddedId</class>
|
||||
</persistence-unit>
|
||||
|
||||
<persistence-unit name="mapsId-pu">
|
||||
<mapping-file>org/apache/openjpa/persistence/enhance/identity/mapsId-orm.xml</mapping-file>
|
||||
<class>org.apache.openjpa.persistence.enhance.identity.Employee1Xml</class>
|
||||
|
@ -17,8 +17,12 @@ regarding copyright ownership. The ASF licenses this file
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" version="1.0">
|
||||
<entity class="org.apache.openjpa.persistence.entity.MixedMappingLocation">
|
||||
<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">
|
||||
<package>org.apache.openjpa.persistence.entity</package>
|
||||
<entity name="MixedMappingLocation" class="MixedMappingLocation">
|
||||
<attributes>
|
||||
<embedded-id name="id"></embedded-id>
|
||||
<basic name="basic1">
|
||||
@ -26,5 +30,12 @@ under the License.
|
||||
</basic>
|
||||
</attributes>
|
||||
</entity>
|
||||
<embeddable class="org.apache.openjpa.persistence.entity.MixedMappingLocationEmbeddedId"></embeddable>
|
||||
<embeddable class="MixedMappingLocationEmbeddedId">
|
||||
<attributes>
|
||||
<basic name="basic10">
|
||||
<column name="basic10_override" length="100"/>
|
||||
</basic>
|
||||
</attributes>
|
||||
</embeddable>
|
||||
|
||||
</entity-mappings>
|
@ -497,14 +497,14 @@ public class AnnotationPersistenceMetaDataParser
|
||||
// setup defaults (ie: Basic fields).
|
||||
ClassMetaData m = getRepository().getCachedMetaData(_cls);
|
||||
if (m == null) {
|
||||
if (!(AccessController.doPrivileged(J2DoPrivHelper.isAnnotationPresentAction(_cls, Entity.class)))
|
||||
.booleanValue()
|
||||
&& !(AccessController.doPrivileged(J2DoPrivHelper.isAnnotationPresentAction(_cls, Embeddable.class)))
|
||||
if (!(AccessController.doPrivileged(J2DoPrivHelper.isAnnotationPresentAction(_cls, Entity.class)))
|
||||
.booleanValue()
|
||||
&& !(AccessController.doPrivileged(J2DoPrivHelper.isAnnotationPresentAction(_cls,
|
||||
MappedSuperclass.class))).booleanValue())
|
||||
return null;
|
||||
}
|
||||
&& !(AccessController.doPrivileged(J2DoPrivHelper.isAnnotationPresentAction(_cls, Embeddable.class)))
|
||||
.booleanValue()
|
||||
&& !(AccessController.doPrivileged(J2DoPrivHelper.isAnnotationPresentAction(_cls,
|
||||
MappedSuperclass.class))).booleanValue())
|
||||
return null;
|
||||
}
|
||||
// find / create metadata
|
||||
ClassMetaData meta = (m == null) ? getMetaData() : m;
|
||||
if (meta == null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user