Why don't you use the ADFbc way?
I assume that you have eo/vo for your master detail tables and have accessors and links created in the data model of the application module. In this case you use the parent view row and get the child rowset via the accessor exposed in the parent. On this you call createInsert and the FK (PK of the parent) is populated by the framework.
Note that my requirement is to create a row in a detail table that's part of a many-to-many.
Following your recommendation, I will create the VO in the detail table via a child rowset for one the master/parent tables.
Is there anything more I will need to do to ensure that the foreign key for the 2nd master/parent table is populated in the detail table as well?
I created a method in the managed bean to add a row via the Iterator for the "junction table", passing the primary keys for each parent table.
protected void createHistoryForProblem(long fkProbrcptReceiptDtl, String activity)
// Get Binding Container for the page
BindingContainer bindingContainer = this.getBindingContainerByPath("com_gac_apps_receiving_view_requestConformityPaperworkPageDef");
DCIteratorBinding dcib = (DCIteratorBinding) bindingContainer.get("AllDetailForAProblemForAReceiptIterator");
RowSetIterator rsi = dcib.getRowSetIterator();
//insert a new row
Row newContactRow = rsi.createRow();
// disable validation of data
//initialize the columns in the row.
//insert the new row
OperationBinding operationBinding = bindingContainer.getOperationBinding("Commit");
Object result = operationBinding.execute();
StringBuffer sb = new StringBuffer();
List errors = operationBinding.getErrors();
for (Object error : errors)
sb.append(error + "/n");
throw new RuntimeException("error occurred while committing data in createHistoryForProblem - " + sb.toString());