Skip to content

Commit 31ba6b5

Browse files
committed
Implement batch insert for MyBatis as serial insert for now. Native batch support to be added later.
1 parent c37bb7d commit 31ba6b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/mybatis/MyBatisDataAccessStrategy.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ public <T> Object insert(T instance, Class<T> domainType, Identifier identifier,
160160

161161
@Override
162162
public <T> Object[] insert(List<RecordDescriptor<T>> recordDescriptors, Class<T> domainType, boolean includeId) {
163-
// TODO: Figure out what this should look like
164-
throw new UnsupportedOperationException();
163+
return recordDescriptors.stream()
164+
.map(recordDescriptor -> insert(recordDescriptor.getInstance(), domainType, recordDescriptor.getIdentifier(), includeId))
165+
.toArray();
165166
}
166167

167168
/*

0 commit comments

Comments
 (0)