eparamo
(Eduardo Paramo)
1
Is this somehow possible?
In my entity I want to display a related object
@InstanceName
@DependsOnProperties({“code”, “objectType”})
public String getInstanceName() {
return String.format("%s (%s)", code, objectType.getName());
}
I’m getting a null pointer and the entire app fails.
krivopustov
(Konstantin Krivopustov)
2
Yes it’s possible.
Perhaps you should check for null in the reference:
@InstanceName
@DependsOnProperties({"code", "objectType"})
public String getInstanceName() {
return String.format("%s (%s)", code, objectType == null ? "" : objectType.getName());
}