如何在adf中插入多个表? [英] how to insert into multiple tables in adf?
问题描述
我有 5 列的 Table1 和相应的 viewObject1
i have Table1 with 5 columns and corresponding viewObject1
ID Value1 Value2 Value3 Value4 Value5
还有 ADF 表单,其中所有这些值都将使用 inputTexts 手动插入
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 :
如果选择 RemoteSource Insted 手动模式(已经完成),则:根据我选择的六个级联 af:selectOneChoice 从另一个 Table2 中检索 5 个值,一旦选择,InputText 将填充 5 个值,这些值将插入 Table1 +并将从 5 个 selectOneChoice 中选择的 5 个 IDS 插入另一个表 Table3,该表具有 Table1 的外键
因此,如果我打开编辑屏幕,我可以稍后检索它
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 ?
推荐答案
在 Oracle ADF 中,当您需要更新 2 个数据库表中的行时,您必须执行以下操作:
In Oracle ADF when you need to update rows in 2 Database Table you have to do as follow :
- 基于表A创建实体对象
- 基于表B创建实体对象
- 基于两个实体对象创建视图对象(为此,将生成一个视图对象,并在两个表之间进行连接.使用适用于您的用例的正确 where/子查询)
- 将包含实体对象的视图对象添加到应用程序模块
- 使用数据源中的这个视图对象来创建表单
当您提交此视图对象时,将提交两个实体对象并更新两个数据库表.插入也一样.
When you'll commit this View Object both Entity Object will be commited and the two database tables updated. Same goes for inserts.
这篇关于如何在adf中插入多个表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!