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.
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.
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.