Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about the @SecondaryTable annotation

 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The following code is from the EJB 3.0 workbook.

My question is what is the relation between the Customer table and ADDRESS_TABLE will be ?? Is It One-To-One ???

I mean for example if two customers have the following addresses
City : NewYork City
Street : NewYork Street
State : NewYork

Will the two customer records point to the same record in the ADDRESS_TABLE

Thanks in advance
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried out your test case practically and found the 2 rows in ADDRESS_TABLE are created(1 for each Customer) even though the address is same for both.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic