|
@@ -759,9 +759,7 @@ public class DynamicInvokeInterceptor implements Interceptor {
|
|
boolean rebuild = false;
|
|
boolean rebuild = false;
|
|
Class<?> model = DatabaseContextHolder.getTableModel(table.getName());
|
|
Class<?> model = DatabaseContextHolder.getTableModel(table.getName());
|
|
if (model != null && Updatable.class.isAssignableFrom(model)) {
|
|
if (model != null && Updatable.class.isAssignableFrom(model)) {
|
|
- if (operator != null) {
|
|
|
|
- rebuild = this.initializeDefaultValue(bound, update, table, Expressions.UPDATER_COLUMN, operator);
|
|
|
|
- }
|
|
|
|
|
|
+ rebuild = this.initializeDefaultValue(bound, update, table, Expressions.UPDATER_COLUMN, operator);
|
|
rebuild |= this.initializeDefaultValue(bound, update, table, Expressions.UPDATE_TIME_COLUMN, datetime);
|
|
rebuild |= this.initializeDefaultValue(bound, update, table, Expressions.UPDATE_TIME_COLUMN, datetime);
|
|
}
|
|
}
|
|
return rebuild;
|
|
return rebuild;
|
|
@@ -898,17 +896,15 @@ public class DynamicInvokeInterceptor implements Interceptor {
|
|
}
|
|
}
|
|
Pair<?, Expression> operator = null, datetime = null;
|
|
Pair<?, Expression> operator = null, datetime = null;
|
|
if (Creatable.class.isAssignableFrom(model)) {
|
|
if (Creatable.class.isAssignableFrom(model)) {
|
|
- if ((operator = Expressions.operator()) != null) {
|
|
|
|
- rebuild = this.initializeDefaultValue(bound, insert, Expressions.CREATOR_COLUMN, operator);
|
|
|
|
- }
|
|
|
|
|
|
+ operator = Expressions.operator();
|
|
datetime = Expressions.datetime();
|
|
datetime = Expressions.datetime();
|
|
|
|
+ rebuild = this.initializeDefaultValue(bound, insert, Expressions.CREATOR_COLUMN, operator);
|
|
rebuild |= this.initializeDefaultValue(bound, insert, Expressions.CREATE_TIME_COLUMN, datetime);
|
|
rebuild |= this.initializeDefaultValue(bound, insert, Expressions.CREATE_TIME_COLUMN, datetime);
|
|
}
|
|
}
|
|
if (Updatable.class.isAssignableFrom(model)) {
|
|
if (Updatable.class.isAssignableFrom(model)) {
|
|
- if (operator != null || (operator = Expressions.operator()) != null) {
|
|
|
|
- rebuild |= this.initializeDefaultValue(bound, insert, Expressions.UPDATER_COLUMN, operator);
|
|
|
|
- }
|
|
|
|
|
|
+ operator = ObjectUtils.ifNull(operator, Expressions::operator);
|
|
datetime = ObjectUtils.ifNull(datetime, Expressions::datetime);
|
|
datetime = ObjectUtils.ifNull(datetime, Expressions::datetime);
|
|
|
|
+ rebuild |= this.initializeDefaultValue(bound, insert, Expressions.UPDATER_COLUMN, operator);
|
|
rebuild |= this.initializeDefaultValue(bound, insert, Expressions.UPDATE_TIME_COLUMN, datetime);
|
|
rebuild |= this.initializeDefaultValue(bound, insert, Expressions.UPDATE_TIME_COLUMN, datetime);
|
|
}
|
|
}
|
|
if (Environmental.class.isAssignableFrom(model) && Expressions.env().getLeft() != null) {
|
|
if (Environmental.class.isAssignableFrom(model) && Expressions.env().getLeft() != null) {
|