cayenne-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=439630&view=rev
Log:
fixing jpa enum defaults - more tests

Modified:
    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/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=439630&r1=439629&r2=439630&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:31:31 2006
@@ -131,9 +131,16 @@
         DbAttribute defaultEnumColumn = (DbAttribute) typesTable
                 .getAttribute("defaultEnum");
         assertNotNull(defaultEnumColumn);
-        assertEquals(
-                TypesMapping.getSqlNameByType(defaultEnumColumn.getType()),
-                Types.INTEGER,
-                defaultEnumColumn.getType());
+        assertEquals(Types.INTEGER, defaultEnumColumn.getType());
+
+        DbAttribute ordinalEnumColumn = (DbAttribute) typesTable
+                .getAttribute("ordinalEnum");
+        assertNotNull(ordinalEnumColumn);
+        assertEquals(Types.INTEGER, ordinalEnumColumn.getType());
+
+        DbAttribute stringEnumColumn = (DbAttribute) typesTable
+                .getAttribute("stringEnum");
+        assertNotNull(stringEnumColumn);
+        assertEquals(Types.VARCHAR, stringEnumColumn.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=439630&r1=439629&r2=439630&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:31:31 2006
@@ -21,6 +21,8 @@
 import java.util.Calendar;
 
 import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 
@@ -37,6 +39,12 @@
 
     @Temporal(value = TemporalType.TIMESTAMP)
     protected Calendar timestampCalendar;
-    
+
     protected MockEnum defaultEnum;
+
+    @Enumerated(value = EnumType.ORDINAL)
+    protected MockEnum ordinalEnum;
+
+    @Enumerated(value = EnumType.STRING)
+    protected MockEnum stringEnum;
 }



Mime
View raw message