File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMR assignment rules...

 
Rekha Rao
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In assignment rules for relationships (pg 154 of ejb spec)..

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

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

changing:

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
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
a1.set(b2);

bhilla
 
Praveen Kumar Mathaley
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 154
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes,the same result.
a2.getB()==null,because the container will do it for us
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic