Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Question about the @SecondaryTable annotation" Watch "Question about the @SecondaryTable annotation" New topic
Author

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about the @SecondaryTable annotation
 
Similar Threads
Bidirectional @OneToOne with JoinTable
Java dunce is back...still can't figure this out
EJB3 Beta Certification - EntityManager BASIC notes. (PART II)
Hibernate @Embeddable Annotation
ERROR [AbstractFlushingEventListener] Could not synchronize database state with session