Hi,
I�ve must be really stupid but, after read tutorials, eMails, source code...
I�ve not be able to run my 1:m code.
Two classes A and B, with A <--- B relation (1:m)
public class A
{
private int id;
private DList listB;
private String name;
public void A()
{
listB = new DListImpl() <---- is this correct or must be use
OJB.getInstance().newDList()???
}
}
public class B
{
private int id;
private int idA;
private A a;
}
In repository.xml must I put a reference-descriptor in class-descriptor for
class B?
<reference-descriptor name="a" classref="es.jgm.docmanager.db.empresa.A">
<foreignkey field-ref="idA"/>
</reference-descriptor>
In collection-descriptor for class A I�ve put
org.apache.ojb.odmg.collections.DListImpl
1) I create a new A object and store in DB using ODMG api.
2) I create a DList using odmg.newDList();
3) Retrieve all B objcets from DB
4) Iterate from all B objects and put the A id in B idA
5) Set list.add( b ) for each iteration
6) Add list in A using setListB( list )
7) Store A
Nothing happends.
I�ve tried without 4) point�, I�ve tried to put B.setA( a ) in point 4),
I�ve tried both ( setIdA() and setA() ) in point 4)
I�ve tried to clean the cache before, during, after to obtain de objects (A
and B-collection) from database.
Nothing happends.
I�ve using ojb rc4, jdk 1.4.1_01, MySql.
Any idea?
Greetings
Jose Galiana
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]