mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1835 Fix with Refactor batch escalation for deferred imported Id
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user