mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#276 - WriteJson not write Transient properties (without using PathProperties)
This commit is contained in:
@@ -108,6 +108,16 @@ public class WriteJson {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isIncludeTransientProperty(BeanProperty prop) {
|
||||
if (!explicitAllProps && currentIncludeProps != null) {
|
||||
// explicitly controlled by pathProperties
|
||||
return currentIncludeProps.contains(prop.getName());
|
||||
} else {
|
||||
// by default include transient properties
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void write(WriteJson writeJson) throws IOException {
|
||||
|
||||
BeanProperty beanProp = desc.getIdProperty();
|
||||
@@ -127,7 +137,7 @@ public class WriteJson {
|
||||
}
|
||||
props = desc.propertiesTransient();
|
||||
for (int j = 0; j < props.length; j++) {
|
||||
if (isIncludeProperty(props[j])) {
|
||||
if (isIncludeTransientProperty(props[j])) {
|
||||
props[j].jsonWrite(writeJson, currentBean);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user