This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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

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