A question concerning reference and real data
stored.
Suppose I have the following objects
:
class A ....
{
B myB;
.......
public void setB(B b);
/*update*/
}
class B ....
{
A myA;
.......
public void setA(A a);
/*update*/
}
In my program, I've got the following code
A objectA;
B objectB;
objectA.setB(objectB);
objectB.setA(objectA);
/*insertion of these objects in my
database....*/
Here is my question : do I have two copies of
objectA and two copies of objectB in my database,
or are the attributes only reference to the
existing objects ?
I want to make multiple reference, but not
multiple insertion !
alain. |