#1835 Fix with Refactor batch escalation for deferred imported Id

This commit is contained in:
rob bygrave
2019-10-10 15:13:21 +13:00
parent d9323b8ab6
commit eb69499ca3
3 changed files with 1 additions and 4 deletions
@@ -20,7 +20,6 @@ public class PersistDeferredRelationship {
private final EntityBean bean;
public PersistDeferredRelationship(SpiEbeanServer ebeanServer, BeanDescriptor<?> beanDescriptor, EntityBean assocBean, ImportedId importedId, EntityBean bean) {
this.ebeanServer = ebeanServer;
this.beanDescriptor = beanDescriptor;
this.assocBean = assocBean;
@@ -41,13 +40,11 @@ public class PersistDeferredRelationship {
// bind the set clause for the importedId
int pos = importedId.bind(1, sqlUpdate, assocBean);
// bind the where clause for the bean
Object[] idValues = beanDescriptor.getIdBinder().getIdValues(bean);
for (int j = 0; j < idValues.length; j++) {
sqlUpdate.setParameter(pos + j, idValues[j]);
}
ebeanServer.execute(sqlUpdate, transaction);
}
}
@@ -785,6 +785,7 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
for (PersistDeferredRelationship deferred : deferredList) {
deferred.execute(this);
}
batchFlush();
deferredList.clear();
}
}
@@ -14,7 +14,6 @@ public class TestOne2OneBookingInvoice extends BaseTestCase {
public void test() {
Booking b = new Booking(3000L);
Invoice ai = new Invoice();
Invoice ci = new Invoice();