Reference -Mikalai Zaikin SCBCD Notes -
Link Chapter 6 Component Contract for CMP
3. One to Many Bidirectional relationships
entityBean_A1.setEntityBean_B(entityBean_A2.getEntityBean_B());
if (entityBean_A2.getEntityBean_B().isEmpty()) { ... } // true
if (entityBeans_B2.isEmpty()) { ... } // true
if (entityBean_B11.getEntityBean_A() == null) { ... } // true
if (entityBean_A1.isIdentical(entityBean_B21.getEntityBean_A())) {
... // true
}
I don't understand the 3'rd if that says
if (entityBean_B11.getEntityBean_A() == null) { ... } // true
Why should entityBean_B11.getEntityBean_A() be null?? If it is A to B is one to many relationship I should be able to associate any any number of B's to A.
If I have B1 and B2 associated to A1 in one to many relationship in the following way
A1 --> B1
A1 --> B2
and I assign B3 to A1 it will be
A1 --> B1
A1 --> B2
A1 --> B3
B1 should not loose its association with A1. In the above example in Mikalai zaikin's notes as far as I understand from the third
if B1 looses association with A1.
Is it right or I did not understand the concept here? [ May 01, 2004: Message edited by: Santosh Ram ]
[ May 02, 2004: Message edited by: Santosh Ram ]