Recently I saw one question in OTN Forum on this topic "Transient Attributes not getting populated when we do VO Substitution". So I thought posting the solution here.
Scenario:
Standard VO has some transient attributes which gets populated by overriding the getter methods in the VORowmpl. When we extend this VO for adding some additional attributes, everything works except the original transient attributes. Those attributes are coming as null.
The reason is, when the extended VORowImpl is getting generated by the Jdeveloper, it will not call the super method (which is already overridden). So you need to modify the getter method of the Transient attribute in the extended VO to call the getter method in the Standard VO using super.
Standard VORowImpl getter method will be something like this :
public String getAttribute1(){ return "Calculated Value"; }
Generated getter method in the extended VORowImpl will be like this:
public String getAttribute1() { return (String) getAttributeInternal("Attribute1"); }
To fix this, modify the getter method of the extended VORowImpl like this:
public String getAttribute1() { //return (String) getAttributeInternal("Attribute1"); return super.getAttribute1(); }
Feel free to point out if anything is missing/wrong in this blog.