BaseDao { public SessionFactory getSourceSessionFactory() { return sourceSessionFactory; }  SessionFactory getSourceSessionFactory(); void setSourceSessionFactory(SessionFactory sourceSessionFactory); SessionWrapper getCurrentSourceSession(); SessionWrapper getCurrentTargetSession(); SessionFactory getTargetSessionFactory(); void setTargetSessionFactory(SessionFactory targetSessionFactory); Session createSourceSession(); void executeSQLQueryForSource(String sqlQuery); void executeSQLQueryForTarget(String sqlQuery); List getSQLResultFromSource(String sqlQuery); List getSQLResultFromTarget(String sqlQuery);  }
@Test public void shouldCreateTable() { Session session = baseDao.getSourceSessionFactory().openSession(); SQLQuery sqlQuery = session.createSQLQuery("create table TestTable(id int)"); sqlQuery.executeUpdate(); session.createSQLQuery("insert into TestTable values(1)").executeUpdate(); session.createSQLQuery("insert into TestTable values(2)").executeUpdate(); SQLQuery selectQuery = session.createSQLQuery("select * from TestTable"); List list = selectQuery.list(); assertThat(list.size(), equalTo(2)); }