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

Confuse with TopLink

 
Harry Kyoshiro
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I have a question with TopLink.

Here is my story step by step,
1. I have existing database so i just used "Create Java Objects from Table Wizard" in wizard i do the following
-. I created top link map named tlMap1 using my connection
-. I select 3 table : employee, department, bank and click finish
-. TopLink and POJO generated

2. I edit TopLink to add query findEmployeeById, findDepartmentById, findBankById

3. I generate session beans

4. I create data control from session beans

5. So far its okay, but than i realize in my database i FORGOT to define FOREIGN KEY relation between department and employee table.

Thats my story and my question is how can we fix that problem with minimal effort since i already had pojo (see step 1), custom query in toplink map (see step 2), session beans (see step 3) and data control (step 4).

FYI : I using JDev 10.1.3.3
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can just edit your code and add in the relationships. You can map the new relationships in the JDev mapping editor, and add the foreign key constraints either in the database, and re-import the tables, or in the JDev table editor and re-generate the tables.
 
Harry Kyoshiro
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@above

Thank for your reply. I think this is the only solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic