mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
#358 - ENH: Add ServerConfig updateAllPropertiesInBatch with a default of true
This commit is contained in:
1 parent
962d7f601d
commit
3fa8f04a4c
12 files changed
+149
-57
No files matched your search
@@ -137,7 +137,6 @@ public class InsertHandler extends DmlHandler {
|
||||
|
||||
checkRowCount(rc);
|
||||
executeDerivedRelationships();
|
||||
persistRequest.postInsert();
|
||||
}
|
||||
|
||||
protected void executeDerivedRelationships() {
|
||||
|
||||
@@ -90,12 +90,12 @@ public final class UpdateMeta {
|
||||
*/
|
||||
public SpiUpdatePlan getUpdatePlan(PersistRequestBean<?> request) {
|
||||
|
||||
ConcurrencyMode mode = request.determineConcurrencyMode();
|
||||
if (request.isDynamicUpdateSql()) {
|
||||
return getDynamicUpdatePlan(mode, request);
|
||||
return getDynamicUpdatePlan(request);
|
||||
}
|
||||
|
||||
// 'full bean' update...
|
||||
ConcurrencyMode mode = request.determineConcurrencyMode();
|
||||
switch (mode) {
|
||||
case NONE:
|
||||
return modeNoneUpdatePlan;
|
||||
@@ -108,14 +108,12 @@ public final class UpdateMeta {
|
||||
}
|
||||
}
|
||||
|
||||
private SpiUpdatePlan getDynamicUpdatePlan(ConcurrencyMode mode, PersistRequestBean<?> persistRequest) {
|
||||
|
||||
// we can use a cached UpdatePlan for the changed properties
|
||||
private SpiUpdatePlan getDynamicUpdatePlan(PersistRequestBean<?> persistRequest) {
|
||||
|
||||
EntityBeanIntercept ebi = persistRequest.getEntityBeanIntercept();
|
||||
|
||||
int hash;
|
||||
if (persistRequest.getTransaction().isUpdateAllLoadedProperties()) {
|
||||
if (persistRequest.determineUpdateAllLoadedProperties()) {
|
||||
hash = ebi.getLoadedPropertyHash();
|
||||
} else {
|
||||
hash = ebi.getDirtyPropertyHash();
|
||||
@@ -132,6 +130,7 @@ public final class UpdateMeta {
|
||||
|
||||
Integer key = Integer.valueOf(hash);
|
||||
|
||||
// check if we can use a cached UpdatePlan
|
||||
SpiUpdatePlan updatePlan = beanDescriptor.getUpdatePlan(key);
|
||||
if (updatePlan != null) {
|
||||
return updatePlan;
|
||||
@@ -144,6 +143,8 @@ public final class UpdateMeta {
|
||||
set.addToUpdate(persistRequest, list);
|
||||
BindableList bindableList = new BindableList(list);
|
||||
|
||||
ConcurrencyMode mode = persistRequest.determineConcurrencyMode();
|
||||
|
||||
// build the SQL for this update statement
|
||||
String sql = genSql(mode, persistRequest, bindableList);
|
||||
|
||||
|
||||
Reference in new issue
Block a user