It's not a secret anymore!
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes CMR assignment rules... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "CMR assignment rules..." Watch "CMR assignment rules..." New topic

CMR assignment rules...

Rekha Rao

Joined: Jan 23, 2001
Posts: 15
In assignment rules for relationships (pg 154 of ejb spec)..

A and B are in one-to-one bidirectional relation..

a1 <--> b1
a2 <--> b2


a1.setB(a2.getB()) will result in

'a2.getB() == null'.

Suppose we just have:

a1.setB(b2) (that is, not accessing b2 through a2), will the container still be aware that b2 is involved with a2 and yield the same result ?
bhilla ratna
Ranch Hand

Joined: Jun 01, 2005
Posts: 59
In bean class cmp fields are not declared. But the getters and setters for cmp fields are declared. So, there is no way we can set


Ratna bhilla<br />SCJP 1.4, SCBCD 1.3, SCWCD 1.4
Praveen Kumar Mathaley
Ranch Hand

Joined: Apr 14, 2003
Posts: 45
can get to local reference to entity bean b in the entity bean a and set it
still container figures it out and makes the reference for other to null
[ August 18, 2005: Message edited by: Praveen Kumar Mathaley ]
chao cai
Ranch Hand

Joined: May 26, 2005
Posts: 154
yes,the same result.
a2.getB()==null,because the container will do it for us

SCEA<br />SCJP 1.2<br />SCBCD<br />MCSD<br />IBM Certified Specialist RUP v2003<br />IBM Certified Solution Designer OOAD vUML2<br /> <br />Phone Number:86-010-82776427
I agree. Here's the link:
subject: CMR assignment rules...
It's not a secret anymore!