1 | public void testUpdateFailureWithExceptionChecking() {↵ | | 1 | public void testUpdateFailureWithParamChecking() {↵
|
2 | Session s = openSession();↵ | | 2 | Session s = openSession();↵
|
3 | s.beginTransaction();↵ | | 3 | s.beginTransaction();↵
|
4 | ExceptionCheckingEntity e = new ExceptionCheckingEntity();↵ | | 4 | ParamCheckingEntity e = new ParamCheckingEntity();↵
|
5 | e.setId( new Long( 1 ) );↵ | | 5 | e.setId( new Long( 1 ) );↵
|
6 | e.setName( "dummy" );↵ | | 6 | e.setName( "dummy" );↵
|
7 | s.update( e );↵ | | 7 | s.update( e );↵
|
8 | try {↵ | | 8 | try {↵
|
9 | s.flush();↵ | | 9 | s.flush();↵
|
10 | fail( "expection flush failure!" );↵ | | 10 | fail( "expection flush failure!" );↵
|
11 | }↵ | | 11 | }↵
|
12 | catch( JDBCException ex ) {↵ | | 12 | catch( HibernateException ex ) {↵
|
13 | // these should specifically be JDBCExceptions...↵ | | 13 | // these should specifically be HibernateExceptions...↵
|
14 | }↵ | | 14 | }↵
|
15 | s.clear();↵ | | 15 | s.clear();↵
|
16 | s.getTransaction().commit();↵ | | 16 | s.getTransaction().commit();↵
|
17 | s.close();↵ | | 17 | s.close();↵
|
18 | | | 18 |
|