@@ -0,0 +1,2913 @@
+/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.jdbi.v3.sqlobject;%0A%0Aimport static org.junit.Assert.assertArrayEquals;%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport org.jdbi.v3.core.H2DatabaseRule;%0Aimport org.jdbi.v3.core.Handle;%0Aimport org.jdbi.v3.core.Something;%0Aimport org.jdbi.v3.sqlobject.customizers.BatchChunkSize;%0Aimport org.jdbi.v3.sqlobject.customizers.RegisterRowMapper;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0A%0Apublic class TestBatchGeneratedKeys%0A%7B%0A    @Rule%0A    public H2DatabaseRule db = new H2DatabaseRule().withPlugin(new SqlObjectPlugin());%0A    private Handle handle;%0A    private UsesBatching b;%0A%0A    @Before%0A    public void setUp() throws Exception%0A    %7B%0A        handle = db.getSharedHandle();%0A        b = handle.attach(UsesBatching.class);%0A    %7D%0A%0A    @Test%0A    public void testReturnKey() throws Exception%0A    %7B%0A        long%5B%5D ids = b.insertNames(%22a%22, %22b%22, %22c%22, %22d%22, %22e%22);%0A        assertArrayEquals(new long%5B%5D %7B 0, 1, 2, 3, 4, 5 %7D, ids);%0A    %7D%0A%0A    @Test%0A    public void testBeanReturn() throws Exception%0A    %7B%0A        Something%5B%5D people = b.insertNamesToBean(Arrays.asList(%22a%22, %22b%22, %22c%22, %22d%22, %22e%22));%0A        assertEquals(5, people.length);%0A        for (int i = 0; i %3C people.length; i++) %7B%0A            assertEquals(i, people%5Bi%5D.getId());%0A            assertEquals(String.valueOf('a' + i), people%5Bi%5D.getName());%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testVarargsList() throws Exception%0A    %7B%0A        List%3CSomething%3E people = b.insertVarargs(%22a%22, %22b%22, %22c%22, %22d%22, %22e%22);%0A        assertEquals(5, people.size());%0A        for (int i = 0; i %3C people.size(); i++) %7B%0A            assertEquals(i, people.get(i).getId());%0A            assertEquals(String.valueOf('a' + i), people.get(i).getName());%0A        %7D%0A    %7D%0A%0A%0A    @BatchChunkSize(4)%0A    @RegisterRowMapper(SomethingMapper.class)%0A    public interface UsesBatching%0A    %7B%0A        @SqlBatch(%22insert into something (name) values (:name)%22)%0A        @GetGeneratedKeys%0A        long%5B%5D insertNames(@Bind(%22name%22) String... names);%0A%0A        @SqlBatch(%22insert into something (name) values (:name)%22)%0A        @GetGeneratedKeys%0A        Something%5B%5D insertNamesToBean(@BindBean Iterable%3CString%3E names);%0A%0A        @SqlBatch(%22insert into something (name) values (:name)%22)%0A        @GetGeneratedKeys%0A        List%3CSomething%3E insertVarargs(String... names);%0A    %7D%0A%7D%0A

Introduce more test cases for @SqlBatch @GetGeneratedKeys that really ought to work