how to insert into multiple tables in adf?

≯℡__Kan透↙ 提交于 2020-01-06 05:57:31

问题


i have Table1 with 5 columns and corresponding viewObject1

ID   Value1 Value2 Value3 Value4 Value5

and there was ADF Form where all those values would inserted manually with inputTexts

but there is a complex enhance need to be done in this form which is :

if selected RemoteSource Insted of manual mode (which was already Done) then : the 5 values will be retrieved from Another Table2 based on my selection of six Cascaded af:selectOneChoice , once selected , the InputText Will Populated with the 5 Values , which will be inserted in Table1 + and insert the 5 IDS which was selected from the 5 selectOneChoice to another table Table3 which has foriegn key of Table1
So I can retrieve it later if i open the edit Screen

what is the general steps i need to follow to Fulfill this requirements ?


回答1:


In Oracle ADF when you need to update rows in 2 Database Table you have to do as follow :

  • Create Entity Object based on table A
  • Create Entity Object based on table B
  • Create View Object based on Both Entity Object (To do so, will generate a View Object with a join between the two table. With the correct where/subqueries for your use case)
  • Add the View Object containing both Entity Object to the Application Module
  • Use this View Object from your datasource to create your form

When you'll commit this View Object both Entity Object will be commited and the two database tables updated. Same goes for inserts.



来源:https://stackoverflow.com/questions/56795181/how-to-insert-into-multiple-tables-in-adf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!