Oracle ADF 11g Validate each entity impl before commiting changes

904 views Asked by At

The code I'm working on is directly manipulating an Entity Object (EO) to insert 5-10k records into the EO's backing table. Yes, it is a bad practice but I don't have time to rewrite the application.

Is there a way, immediately before committing changes, to test to see if a primary key already exists?

Better yet, is there a way to customize the query executed when the transaction is committed? I'd like to add something like INSERT WHERE NOT EXISTS.

My sloppy alternative is to commit each change one at a time which will create undesired app-to-DB traffic.

Please let me know if I can provide any additional information.

Thank you VERY much for reading!

1

There are 1 answers

2
Florin Marcus On BEST ANSWER

Better yet, is there a way to customize the query executed when the transaction is committed? I'd like to add something like INSERT WHERE NOT EXISTS.

You can control SQL Statements Entity Objects generate by overriding SQLBuilder class as below: http://www.jobinesh.com/2013/02/customizing-sql-builder-class.html