openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r815396 - in /openjpa/trunk: openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Members.java
Date Tue, 15 Sep 2009 16:59:22 GMT
Author: ppoddar
Date: Tue Sep 15 16:59:21 2009
New Revision: 815396

URL: http://svn.apache.org/viewvc?rev=815396&view=rev
Log:
Persistence attribute type for singular attributes

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Members.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java?rev=815396&r1=815395&r2=815396&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/meta/TestMetamodel.java
Tue Sep 15 16:59:21 2009
@@ -29,6 +29,7 @@
 import javax.persistence.metamodel.ListAttribute;
 import javax.persistence.metamodel.ManagedType;
 import javax.persistence.metamodel.SetAttribute;
+import javax.persistence.metamodel.SingularAttribute;
 import javax.persistence.metamodel.Attribute.PersistentAttributeType;
 import javax.persistence.metamodel.Bindable.BindableType;
 import javax.persistence.metamodel.PluralAttribute.CollectionType;
@@ -304,6 +305,11 @@
         assertFalse(entity.hasSingleIdAttribute());
     }
 
+    public void testBasicAttributeType() {
+        ManagedType<ImplicitFieldAccessBase> e0 = model.entity(ImplicitFieldAccessBase.class);
+        SingularAttribute<ImplicitFieldAccessBase,?> pInt = e0.getDeclaredSingularAttribute("primitiveInt");
+        assertEquals(PersistentAttributeType.BASIC, pInt.getPersistentAttributeType());
+    }
     
     void assertFails(ManagedType<?> type, String name, boolean dec) {
         try {

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Members.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Members.java?rev=815396&r1=815395&r2=815396&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Members.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Members.java
Tue Sep 15 16:59:21 2009
@@ -126,7 +126,7 @@
          *  Returns the persistent category for the attribute.
          */
         public PersistentAttributeType getPersistentAttributeType() {
-            if (fmd.isEmbedded())
+            if (fmd.isEmbeddedPC())
                 return PersistentAttributeType.EMBEDDED;
             if (fmd.isElementCollection())
                 return PersistentAttributeType.ELEMENT_COLLECTION;



Mime
View raw message