opencirclesolutions-wove commented on code in PR #2412:
URL: https://github.com/apache/causeway/pull/2412#discussion_r1611575104
##########
persistence/commons/src/main/java/org/apache/causeway/persistence/commons/integration/repository/RepositoryServiceDefault.java:
##########
@@ -99,6 +105,27 @@ public <T> T detachedEntity(final @NonNull T entity) {
return factoryService.detachedEntity(entity);
}
+ @Override
+ public <T> T execInBulk(Callable<T> callable, Class<?>... classes) {
+ try {
+ Arrays.stream(classes).forEach(aClass -> setBulkMode(aClass,
Boolean.TRUE));
+ return callable.call();
+ } catch (Exception e) {
+ log.error("Error executing bulk", e);
+ return null;
+ } finally {
+ Arrays.stream(classes).forEach(aClass -> setBulkMode(aClass,
Boolean.FALSE));
+ }
+ }
+
+ protected <T extends Class> void setBulkMode(final T aClass, final
Boolean bulkMode) {
Review Comment:
That was the idea.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]