A quick look at the javaDoc shows
So looping through the attribute count, checking whether the attribute is an attribute or association and your are done. Note that JavaDocs are google searchable (as I did in this case)
Thanks for your reply, But getAttributeCount() just gives you the total number of attributes in Entity, but I just want only modified/updated attribute count, How can we get that?
Also, how do I get old value as well ? For instance, User modified first Name from 'ABC' to 'XYZ' , I need to capture the old value i.e 'ABC' as well. How can we do that?
Thanks in advance.
1 person found this helpful
There is no method to get the count of changed attributes. A look into the java doc reveals that the entity method
protected java.lang.Object getPostedAttribute(int index)
Gets the value originally read for this attribute from the database.
is the one which gives you the original value for each attribute. The method Frank showed you
java.lang.Object getAttribute(int index)
Returns the value of an attribute, given an integer index value.
gives you the actual value. Now you only need to iterate over all attributes and compare the values to find the modified values and count them.
Thanks for your reply, I am able to get old and new values as per your response, but I am worried to check every attribute to identify whether modified or not..
do you think in next upcoming ADF version will support this requirement ? Just to get only modified attribute names.
I found a way to get only count of attributes changed i.e this.getAttributeChangedCount(); This method is part of EntityImpl, which gives the count of attributes that were modified.
but, I need the index of modified attributes
Any one have an idea about getting attribute name based on index of attribute ?
User, if you look at the Java doc of EntityImpl you find methods named isAttributeChanged(int index) which you should look into to find the changed attributes.
To get the name of an attribute via its index you can use
Message was edited by: TimoHahn And I don't think there will be a method implemented doing your request in a future version, but as I'm not an Oracle employee this is only a guess. You can file an enhancement request for this if you have a support contact.