Skip to content

Commit ff07318

Browse files
committed
refactor: 优化属性设置逻辑
1 parent 23309cd commit ff07318

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hsweb-easy-orm-core/src/main/java/org/hswebframework/ezorm/core/ApacheCommonPropertyOperator.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ public Optional<Object> getProperty(Object object, String name) {
3838
public void setProperty(Object object, String name, Object value) {
3939
try {
4040
if (value == null) {
41+
if (object instanceof Extendable) {
42+
if (propertyUtils.getPropertyDescriptor(object, name) == null) {
43+
((Extendable) object).setExtension(name, null);
44+
return;
45+
}
46+
}
4147
propertyUtils.setProperty(object, name, null);
4248
return;
4349
}

0 commit comments

Comments
 (0)