Sunday, March 22, 2009

JDev/ADF sample - Create Operation for Master-Detail Relationship

  • Create Operation for Master-Detail Relationship. Its very frequent requirement in Oracle ADF applications, when developer needs to implement Master-Detail relationship with Create functionality. Actually, its very easy to implement Master-Detail in ADF, the same is for Create operation. However, there is one thing you should know, especially if you are new to ADF. Let's say you are implementing functionality to allow users to insert data into Master and into Detail, its fine - you can just drag and drop Create or CreateInsert action from Data Control. But you will face a problem, when user will try to insert Master and Detail record during the same transaction. I'm describing in this post how to avoid such problem.
    Download - CreateMasterDetail.zip
Spanish Summary:

El desarrollo de pantallas master-detail son comunes y sencillas de realizar usando ADF. Sin embargo, si se pretende grabar simultaneamente ambos registros, saldrá un error debido a que requerirá grabar primer la información que esta en cabecerá y luego la información que se encuentra en el detalle. Para evitar la salida de un error indecifrable, Andrejus nos muestra un tip muy útil en este post.

6 comments:

Reena said...

Hello Andrejus ,
We have a requirement to show Master-Detail data in hierarchical format for which I have used RichTree. In the Tree, currently I am able to save detail data only for the current node. That is, if I edit multiple nodes and click on the Save button, only the last updated node is getting saved. Can you please tell me how do I save all the edited nodes at one click of the Save button?
Thanks,
RM.

Andrejus Baranovskis said...

Hi,

Default behavior of Commit action is to save all rows at once.

Andrejus

Khan Khattak said...

Hello Andrejus,

i am sorry, but your post is only helping experts and experts rarely need help. i download and open your application, but understand nothing, how you assemble it? the post you provide , begginers often stuck with this functionality.
i am searching from morning but never find any step by step blog or tutorial which guide me for crud operation on master detail in adf.
please provide at least some details how you did it , so we get understand.

Thanks

Andrejus Baranovskis said...

You should read developer guide about exact steps. Try to follow Oracle step by step tutorials. Good luck.

Regards,
Andrejus

Hope said...

Those examples are really good and helpful.however,all examples related to Master details table/form are not available to download.
Wish Author can fix the links.
Thank you so so so much.

Andrejus Baranovskis said...

You can download all old samples from Google Archive - https://code.google.com/archive/p/jdevsamples/downloads