File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
src/test/java/org/apache/ibatis/submitted/batch_keys Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 37
37
import org .apache .ibatis .session .SqlSessionFactory ;
38
38
import org .apache .ibatis .session .SqlSessionFactoryBuilder ;
39
39
import org .junit .Before ;
40
- import org .junit .Ignore ;
41
40
import org .junit .Test ;
42
41
43
42
public class BatchKeysTest {
@@ -113,8 +112,6 @@ public void testJdbc3Support() throws Exception {
113
112
114
113
}
115
114
116
- @ Ignore // Jdbc3 keys will not work with current implementation
117
- // but it seems that neither derby nor hsdqlb are able to return keys with batches
118
115
@ Test
119
116
public void testInsertJdbc3 () throws Exception {
120
117
SqlSession sqlSession = sqlSessionFactory .openSession (ExecutorType .BATCH );
@@ -124,8 +121,8 @@ public void testInsertJdbc3() throws Exception {
124
121
User user2 = new User (null , "Valentina" );
125
122
sqlSession .insert ("insertIdentity" , user2 );
126
123
sqlSession .flushStatements ();
127
- assertEquals (new Integer ( 50 ), user1 .getId ());
128
- assertEquals (new Integer ( 50 ), user2 .getId ());
124
+ assertEquals (Integer . valueOf ( 0 ), user1 .getId ());
125
+ assertEquals (Integer . valueOf ( 1 ), user2 .getId ());
129
126
sqlSession .commit ();
130
127
} finally {
131
128
sqlSession .close ();
Original file line number Diff line number Diff line change 41
41
</select >
42
42
43
43
<insert id =" insertIdentity" keyProperty =" id" useGeneratedKeys =" true" >
44
- insert into users2 (id, name) values(null, #{name})
44
+ insert into users2 (name) values(#{name})
45
45
</insert >
46
46
47
47
<select id =" selectIdentity" resultType =" org.apache.ibatis.submitted.batch_keys.User" >
You can’t perform that action at this time.
0 commit comments