1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to persist into 2 or more table

Discussion in 'Oracle Forms and Reports' started by callme_harry, Nov 5, 2008.

  1. callme_harry

    callme_harry Active Member

    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    80
    Hi,


    So far in tutorial or article i learned only cover persist to one table only.
    It's easy with ADF Data Control to make a form from Data Control and persist into database if only 1 table.

    But what about if in my form require to save more than 2 table.

    For example i have a single page JSF form contain 3 section : company, contact person, and complaint. And 1 button to save/persist.

    When user click save button, it will save into 3 table : company, contact person with company id as FK, complaint as company id and contact person id as FK.

    FYI : I'm using JDev 10.1.3 and EJB/TopLink as Business Service.

    Thanks in advance.
     
  2. tyro

    tyro Forum Genius

    Messages:
    368
    Likes Received:
    20
    Trophy Points:
    260
    Location:
    India
    hi harry, i am not a adf expert but more of a database person. However looking at your requirement, what I understand is that you have three tables and one JSF form with which you want to populate in all three tables on a single button press.

    Have you considered creating a view from the three tables and link your JSF page to the view. So use this single view instead of a table with ADF data control. Now the catch will be use an INSTEAD OF trigger on the view. So whenever an update happens on the view, use the INSTEAD OF trigger to insert into the three company, contact person, and complaint sections.

    I am not sure this may work but you can give it a try. But this will be a database solution. I am sure someone here who knows more ADF can volunteer an answer from that perspective.
     
  3. callme_harry

    callme_harry Active Member

    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    80
    Tyro,


    After evaluating some suggestion, using code in backing bean to handle persist is the only way.

    I'm using UnitOfWork API from TopLink.