| Eclipselink force update [message #765872] |
Wed, 14 December 2011 15:18  |
urkings Missing name Messages: 8 Registered: December 2011 |
Junior Member |
|
|
|
I am looking to make a force update using eclipselink eventhough the column value is supposedly the same. Currently in this scenario Eclipselink does not generate a Update query, but I am looking to see if there is any configuration changes I can do to make eclipselink generate a UPDATE statement (for the setXXXX column) irrespective of the value of the column being the same as the new value or not. Any help is appreciated. Thanks in advance.
|
|
|
| Re: Eclipselink force update [message #768214 is a reply to message #765872] |
Mon, 19 December 2011 14:12   |
James Sutherland Messages: 1834 Registered: July 2009 |
Senior Member |
|
|
You can try refreshing the object first before making your change, then you should be sure if the value changed.
If it is actually the same, then why do you want to updated it?
Potentially you could configure a custom update query on the DescriptorQueryManager, or perhaps process the update using a JPQL update statement.
If using change tracking you could manually add a ChangeRecord to the objects ObjectChangeSet.
James : Wiki : Book : Blog
|
|
|
|
|
| Re: Eclipselink force update [message #769724 is a reply to message #768715] |
Thu, 22 December 2011 10:39   |
James Sutherland Messages: 1834 Registered: July 2009 |
Senior Member |
|
|
You might also be able to use a writeOnly TransformationMapping (would need to add a field only TransformationMapping in a customizer).
But if you already have it working, but just don't want to have to test it, then I can't see how you could make any change that did not require testing...
James : Wiki : Book : Blog
|
|
|
|
| Re: Eclipselink force update [message #769749 is a reply to message #769727] |
Thu, 22 December 2011 11:21  |
urkings Missing name Messages: 8 Registered: December 2011 |
Junior Member |
|
|
|
Thanks James. Sorry, you got me wrong. I will test all possible options, but my validation team will finally accept only the option with minimal changes as they have to consider the impact on the whole application. I shall try this approach and see.
|
|
|
Powered by
FUDForum. Page generated in 0.06150 seconds