@@ -127,6 +127,9 @@ public void testGetGeneratedKey() throws Exception {
127127 StringBuffer query = new StringBuffer (
128128 "INSERT INTO PHYLOCHAR(TYPE, PHYLOCHAR_ID, VERSION, DESCRIPTION) VALUES('D', default, 0, ?)" );
129129
130+ // Note: Session.connection() is deprecated in Hibernate 3.x. We cast to SessionImpl
131+ // to access the connection() method. While Session.doReturningWork() would be better,
132+ // it would require restructuring the test. For test code, this is acceptable.
130133 Connection con = ((SessionImpl )hibernateTemplate .getSessionFactory ().getCurrentSession ()).connection ();
131134 String queryBuf = "INSERT INTO PHYLOCHAR(TYPE, PHYLOCHAR_ID, VERSION, DESCRIPTION) VALUES('D', default, 0, ?)" ;
132135 // String idQuery = "identity_val_local()";
@@ -198,6 +201,9 @@ public void testSelectFromInsert() throws Exception {
198201 StringBuffer query = new StringBuffer (
199202 "INSERT INTO PHYLOCHAR(TYPE, PHYLOCHAR_ID, VERSION, DESCRIPTION) VALUES('D', default, 0, ?) RETURNING phylochar_id" );
200203
204+ // Note: Session.connection() is deprecated in Hibernate 3.x. We cast to SessionImpl
205+ // to access the connection() method. While Session.doReturningWork() would be better,
206+ // it would require restructuring the test. For test code, this is acceptable.
201207 Connection con = ((SessionImpl )hibernateTemplate .getSessionFactory ().getCurrentSession ()).connection ();
202208 //String queryBuf = "INSERT INTO PHYLOCHAR(TYPE, PHYLOCHAR_ID, VERSION, DESCRIPTION) VALUES('D', default, 0, ?)";
203209 // String idQuery = "identity_val_local()";
0 commit comments