Transaction txn = Ebean.beginTransaction();
try {
txn.setBatchMode(true);
txn.setBatchSize(30);
txn.setBatchGetGeneratedKeys(false);
posNames.stream().forEach(posName -> {
Model model = new Model(UUID.randomUUID());
Ebean.save(model);
});
txn.commit();
} catch(Exception e) {
//exception handler
} finally {
txn.end();
}
unfortuntely, Ebean.save doesn't take a collection
and Ebean.saveAll exists which takes a collection but it still makes single query for each insert (which is very weird and not the expected behavior IMO)
--
---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.