cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r439633 - in /incubator/cayenne/main/trunk/core/cayenne-jpa/src: main/java/org/apache/cayenne/jpa/map/ test/java/org/apache/cayenne/jpa/bridge/ test/java/org/apache/cayenne/jpa/entity/
Date Sat, 02 Sep 2006 18:40:40 GMT
Author: aadamchik
Date: Sat Sep  2 11:40:39 2006
New Revision: 439633

URL: http://svn.apache.org/viewvc?rev=439633&view=rev
Log:
fixing array properties processing when loading JPA defaults

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaPropertyDescriptor.java
    incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java
    incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockTypesEntity.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaPropertyDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaPropertyDescriptor.java?rev=439633&r1=439632&r2=439633&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaPropertyDescriptor.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaPropertyDescriptor.java
Sat Sep  2 11:40:39 2006
@@ -119,15 +119,17 @@
      * an error if no annotation is present and none of the above rules apply.
      */
     public boolean isDefaultNonRelationalType() {
+        return isDefaultNonRelationalType(getTargetEntityType());
+    }
 
-        Class type = getTargetEntityType();
-
+    boolean isDefaultNonRelationalType(Class type) {
+        
         if (type.isPrimitive() || type.isEnum()) {
             return true;
         }
 
         if (type.isArray()) {
-            type = type.getComponentType();
+            return isDefaultNonRelationalType(type.getComponentType());
         }
 
         // it is sufficient to check serializability as all the types mentioned in the

Modified: incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java?rev=439633&r1=439632&r2=439633&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/bridge/DataMapConverterTest.java
Sat Sep  2 11:40:39 2006
@@ -142,5 +142,9 @@
                 .getAttribute("stringEnum");
         assertNotNull(stringEnumColumn);
         assertEquals(Types.VARCHAR, stringEnumColumn.getType());
+
+        DbAttribute byteArrayColumn = (DbAttribute) typesTable.getAttribute("byteArray");
+        assertNotNull(byteArrayColumn);
+        assertEquals(Types.BINARY, byteArrayColumn.getType());
     }
 }

Modified: incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockTypesEntity.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockTypesEntity.java?rev=439633&r1=439632&r2=439633&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockTypesEntity.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockTypesEntity.java
Sat Sep  2 11:40:39 2006
@@ -47,4 +47,6 @@
 
     @Enumerated(value = EnumType.STRING)
     protected MockEnum stringEnum;
+    
+    protected byte[] byteArray;
 }



Mime
View raw message