Skip to content

Commit 47bae1b

Browse files
Copilotrvosa
andcommitted
Fix deprecated Session.connection() calls in EnvironmentTest
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
1 parent c9f4dce commit 47bae1b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

treebase-core/src/test/java/org/cipres/treebase/dao/EnvironmentTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.sql.Statement;
88

99
import org.hibernate.Query;
10+
import org.hibernate.impl.SessionImpl;
1011

1112
import com.mchange.v2.c3p0.ComboPooledDataSource;
1213

@@ -126,7 +127,7 @@ public void testGetGeneratedKey() throws Exception {
126127
StringBuffer query = new StringBuffer(
127128
"INSERT INTO PHYLOCHAR(TYPE, PHYLOCHAR_ID, VERSION, DESCRIPTION) VALUES('D', default, 0, ?)");
128129

129-
Connection con = hibernateTemplate.getSessionFactory().getCurrentSession().connection();
130+
Connection con = ((SessionImpl)hibernateTemplate.getSessionFactory().getCurrentSession()).connection();
130131
String queryBuf = "INSERT INTO PHYLOCHAR(TYPE, PHYLOCHAR_ID, VERSION, DESCRIPTION) VALUES('D', default, 0, ?)";
131132
// String idQuery = "identity_val_local()";
132133

@@ -197,7 +198,7 @@ public void testSelectFromInsert() throws Exception {
197198
StringBuffer query = new StringBuffer(
198199
"INSERT INTO PHYLOCHAR(TYPE, PHYLOCHAR_ID, VERSION, DESCRIPTION) VALUES('D', default, 0, ?) RETURNING phylochar_id");
199200

200-
Connection con = hibernateTemplate.getSessionFactory().getCurrentSession().connection();
201+
Connection con = ((SessionImpl)hibernateTemplate.getSessionFactory().getCurrentSession()).connection();
201202
//String queryBuf = "INSERT INTO PHYLOCHAR(TYPE, PHYLOCHAR_ID, VERSION, DESCRIPTION) VALUES('D', default, 0, ?)";
202203
// String idQuery = "identity_val_local()";
203204

0 commit comments

Comments
 (0)