Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Tuesday, December 28, 2010

Row STATUS_INITIALIZED and STATUS_NEW behavior in ADF 11g

When an entity row is created it's row status is STATUS_NEW . This means row is added in the transaction's list of changes to be validated or posted or committed. This is fine and expected in most of the cases. However, during complex business objects like master-detail there comes the situation where you may want to turn off these validations until both master and detail are available. For such situations to remove the row from transactions's list of changes ADF exposes an api setNewRowStatus(ROW.STATUS_INITIALIZED).

This is specifically helpful when master-detail association is a composite association and situation demands to create the detail rows before the master row. In that case without setting the row status to STATUS_INITIALIZED you will face:


JBO-25030: Detail entity with row key null cannot find or invalidate its owning entity.


There is no harm programatically changing the row status to STATUS_INITIALIZED or STATUS_NEW using the setNewRowStatus api as long as you understand its implications.

No comments: