learn java
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question about the @SecondaryTable annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Question about the @SecondaryTable annotation" Watch "Question about the @SecondaryTable annotation" New topic

Question about the @SecondaryTable annotation

Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361

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

SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
Life is the biggest school
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
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.

Thanks and Regards
Have you tried LearnNowOnline? http://www.learnnowonline.com/
subject: Question about the @SecondaryTable annotation