allow update createdAt and deletedAt
This commit is contained in:
@ -263,15 +263,9 @@ public class SQLProvider {
|
||||
TimiException.required(meta.idFieldColumn, "not found id field in %s".formatted(meta.entityClass));
|
||||
TimiException.required(meta.canUpdate, "not allow update for %s".formatted(meta.entityClass));
|
||||
|
||||
if (entity instanceof Creatable creatable) {
|
||||
creatable.setCreatedAt(null);
|
||||
}
|
||||
if (entity instanceof Updatable updatable) {
|
||||
updatable.setUpdatedAt(Time.now());
|
||||
}
|
||||
if (entity instanceof Deletable deletable) {
|
||||
deletable.setDeletedAt(null);
|
||||
}
|
||||
String setClause = meta.fieldColumnList.stream()
|
||||
.filter(FieldColumn::isNotId)
|
||||
.filter(fc -> fc.isNotNull(entity))
|
||||
|
||||
Reference in New Issue
Block a user