Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!

Fofa He

Greenhorn
+ Follow
since Jun 28, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Fofa He

I've just passed SCBCD5 with score 96%
Thanks JavaRanch and the ranchers,especially Satya Maheshwari and Mikalai Zaikin
Thanks to Oreilly's EJB3,Mikalai Zaikin's Study Guide,EJB Spec...
[ December 28, 2007: Message edited by: Fofa He ]
13 years ago

For answer C to be correct, it was mandatory that the foreign key had a unique constraint on it.


Hi Satya, I haven't found the unique restriction stated in spec, and I haven't found it in generated sql(Container is JBoss AS 4.2.1.GA)...So I am still a little confused...
But anyway,thanks for your help!It is the best answer for me now
I think so. All 4 methods are illegal to be invoked for MDB.
Hi guys, could you help me with the following question?
I am confused by B and C. I think there is nothing wrong with C, regarding syntax/restriction/specification. The only reason we should choose B instead of C ,is that B makes more sense in reallife ,right? Or have i mistaken ?Please correct me if i was wrong. Thanks in advance!

15). There are two tables in a database, Celery and Carrot. Celery contains a foreign key to Carrot. Each table has a primary key, and there are no other constraints on the tables. No descriptors are used, and in the following options each scenario depicts all the mapping information pertaining to the relationship. Which entities accurately model this database scenario?

A: @Entity Celery {
/* ... */
}
@Entity Carrot {
@ManyToOne
Celery celery;
/* ... */
}

B: @Entity Celery {
@ManyToOne
Carrot carrot;
/* ... */
}
@Entity Carrot {
/* ... */
}

C: @Entity Celery {
@OneToOne
Carrot carrot;
/* ... */
}
@Entity Carrot {
/* ... */
}

D: @Entity Celery {
/* ... */
}
@Entity Carrot {
@OneToOne
Carrot carrot;
/* ... */
}
[ December 14, 2007: Message edited by: Fofa He ]