Skip to content

Commit e929593

Browse files
committed
Better names
1 parent d084d53 commit e929593

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/main/java/org/mybatis/dynamic/sql/util/SqlProviderAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public String insert(InsertStatementProvider<?> insertStatement) {
3838
return insertStatement.getInsertStatement();
3939
}
4040

41-
public String multiRowInsert(MultiRowInsertStatementProvider<?> insertStatement) {
41+
public String insertMultiple(MultiRowInsertStatementProvider<?> insertStatement) {
4242
return insertStatement.getInsertStatement();
4343
}
4444

src/test/java/examples/generated/always/mybatis/GeneratedAlwaysAnnotatedMapper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public interface GeneratedAlwaysAnnotatedMapper {
5555
@UpdateProvider(type=SqlProviderAdapter.class, method="update")
5656
int update(UpdateStatementProvider updateStatement);
5757

58-
@InsertProvider(type=SqlProviderAdapter.class, method="multiRowInsert")
59-
int multiInsert(MultiRowInsertStatementProvider<GeneratedAlwaysRecord> multiInsert);
58+
@InsertProvider(type=SqlProviderAdapter.class, method="insertMultiple")
59+
int insertMultiple(MultiRowInsertStatementProvider<GeneratedAlwaysRecord> multiInsert);
6060

6161
// TODO - this is kludgy. Currently MyBatis does not support nested lists in parameter objects
6262
// when returning generated keys.
@@ -66,9 +66,9 @@ public interface GeneratedAlwaysAnnotatedMapper {
6666
"${insertStatement}"
6767
})
6868
@Options(useGeneratedKeys=true, keyProperty="records.fullName")
69-
int multiInsertWithGeneratedKeys(@Param("insertStatement") String statement, @Param("records") List<GeneratedAlwaysRecord> records);
69+
int insertMultipleWithGeneratedKeys(@Param("insertStatement") String statement, @Param("records") List<GeneratedAlwaysRecord> records);
7070

71-
default int multiInsertWithGeneratedKeys(MultiRowInsertStatementProvider<GeneratedAlwaysRecord> multiInsert) {
72-
return multiInsertWithGeneratedKeys(multiInsert.getInsertStatement(), multiInsert.getRecords());
71+
default int insertMultipleWithGeneratedKeys(MultiRowInsertStatementProvider<GeneratedAlwaysRecord> multiInsert) {
72+
return insertMultipleWithGeneratedKeys(multiInsert.getInsertStatement(), multiInsert.getRecords());
7373
}
7474
}

src/test/java/examples/generated/always/mybatis/GeneratedAlwaysAnnotatedMapperTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public void testMultiInsertWithRawMyBatisAnnotations() {
194194
" (#{records[2].id,jdbcType=INTEGER}, #{records[2].firstName,jdbcType=VARCHAR}, #{records[2].lastName,jdbcType=VARCHAR})," +
195195
" (#{records[3].id,jdbcType=INTEGER}, #{records[3].firstName,jdbcType=VARCHAR}, #{records[3].lastName,jdbcType=VARCHAR})";
196196

197-
int rows = mapper.multiInsertWithGeneratedKeys(statement, records);
197+
int rows = mapper.insertMultipleWithGeneratedKeys(statement, records);
198198

199199
assertAll(
200200
() -> assertThat(rows).isEqualTo(4),
@@ -207,7 +207,7 @@ public void testMultiInsertWithRawMyBatisAnnotations() {
207207
}
208208

209209
@Test
210-
public void testMultiInsertWithList() {
210+
public void testMultiInsertWithListAndGeneratedKeys() {
211211
try (SqlSession session = sqlSessionFactory.openSession()) {
212212
GeneratedAlwaysAnnotatedMapper mapper = session.getMapper(GeneratedAlwaysAnnotatedMapper.class);
213213
List<GeneratedAlwaysRecord> records = getTestRecords();
@@ -229,7 +229,7 @@ public void testMultiInsertWithList() {
229229

230230
assertThat(multiRowInsert.getInsertStatement()).isEqualTo(statement);
231231

232-
int rows = mapper.multiInsertWithGeneratedKeys(multiRowInsert);
232+
int rows = mapper.insertMultipleWithGeneratedKeys(multiRowInsert);
233233

234234
assertAll(
235235
() -> assertThat(rows).isEqualTo(4),
@@ -271,7 +271,7 @@ public void testMultiInsertWithArray() {
271271

272272
assertThat(multiRowInsert.getInsertStatement()).isEqualTo(statement);
273273

274-
int rows = mapper.multiInsert(multiRowInsert);
274+
int rows = mapper.insertMultiple(multiRowInsert);
275275
assertThat(rows).isEqualTo(2);
276276
}
277277
}
@@ -300,7 +300,7 @@ public void testMultiInsertWithArrayAndVariousMappings() {
300300

301301
assertThat(multiRowInsert.getInsertStatement()).isEqualTo(statement);
302302

303-
int rows = mapper.multiInsertWithGeneratedKeys(multiRowInsert);
303+
int rows = mapper.insertMultipleWithGeneratedKeys(multiRowInsert);
304304

305305
assertAll(
306306
() -> assertThat(rows).isEqualTo(1),

0 commit comments

Comments
 (0)