Author: stliu
Date: 2010-01-04 14:03:05 -0500 (Mon, 04 Jan 2010)
New Revision: 18401
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java
Log:
JBPAPP-3057 Core - DB2 - Assertion Failed in EntityTest.testColumn
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java
===================================================================
---
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java 2010-01-04
19:00:01 UTC (rev 18400)
+++
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java 2010-01-04
19:03:05 UTC (rev 18401)
@@ -50,13 +50,26 @@
tx.commit();
s.close();
}
-
+
public void testColumn() throws Exception {
//put an object in DB
Session s = openSession();
Transaction tx = s.beginTransaction();
Flight firstOne = new Flight();
firstOne.setId( new Long( 1 ) );
+ firstOne.setName( "AF3202" );
+ firstOne.setDuration( new Long( 1000000 ) );
+ firstOne.setDurationInSec( 2000 );
+ s.save( firstOne );
+ s.flush();
+ tx.commit();
+ s.close();
+
+
+ s = openSession();
+ tx = s.beginTransaction();
+ firstOne = new Flight();
+ firstOne.setId( new Long( 2 ) );
firstOne.setName( null );
try {
@@ -71,12 +84,9 @@
s.close();
}
- //insert an object and check that name is not updatable
s = openSession();
tx = s.beginTransaction();
- firstOne = new Flight();
- firstOne.setId( new Long( 1 ) );
- firstOne.setName( "AF3202" );
+ firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
firstOne.setTriggeredData( "should not be insertable" );
tx.commit();
s.close();
Show replies by date