cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r439480 - in /incubator/cayenne/main/trunk/core/cayenne-jpa/src/test/java/org/apache/cayenne/jpa: bridge/DataMapConverterTest.java entity/MockTypesEntity.java
Date Fri, 01 Sep 2006 21:00:08 GMT
Author: aadamchik
Date: Fri Sep  1 14:00:07 2006
New Revision: 439480

URL: http://svn.apache.org/viewvc?rev=439480&view=rev
Log:
tests of TemporalType annotation

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=439480&r1=439479&r2=439480&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
Fri Sep  1 14:00:07 2006
@@ -114,5 +114,17 @@
                         + TypesMapping.getSqlNameByType(defaultCalColumn.getType()),
                 Types.TIMESTAMP,
                 defaultCalColumn.getType());
+
+        DbAttribute timeColumn = (DbAttribute) typesTable.getAttribute("timeCalendar");
+        assertNotNull(timeColumn);
+        assertEquals(Types.TIME, timeColumn.getType());
+        
+        DbAttribute dateColumn = (DbAttribute) typesTable.getAttribute("dateCalendar");
+        assertNotNull(dateColumn);
+        assertEquals(Types.DATE, dateColumn.getType());
+        
+        DbAttribute timestampColumn = (DbAttribute) typesTable.getAttribute("timestampCalendar");
+        assertNotNull(timestampColumn);
+        assertEquals(Types.TIMESTAMP, timestampColumn.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=439480&r1=439479&r2=439480&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
Fri Sep  1 14:00:07 2006
@@ -21,9 +21,20 @@
 import java.util.Calendar;
 
 import javax.persistence.Entity;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
 
 @Entity
 public class MockTypesEntity {
 
     protected Calendar defaultCalendar;
+
+    @Temporal(value = TemporalType.TIME)
+    protected Calendar timeCalendar;
+
+    @Temporal(value = TemporalType.DATE)
+    protected Calendar dateCalendar;
+
+    @Temporal(value = TemporalType.TIMESTAMP)
+    protected Calendar timestampCalendar;
 }



Mime
View raw message