Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TopLink ask how to persist into multiple table

 
Harry Kyoshiro
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not that familiar with JDev ADF, but I would assume that you need to define a relationship in your object model from the Complaint to the Company and the Contact.
 
Harry Kyoshiro
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James,


Frank Nimphius from OTN has gave me solution. He said create method in session facace that takes 2 or more argument, and then write the code to persist using UnitOfWork.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic