*/
public void testOrReferenceOnSameTable() throws Exception
{
deleteData(PersonImpl.class);
PersonImpl jimmy = new PersonImpl();
PersonImpl joe = new PersonImpl();
PersonImpl father = new PersonImpl();
PersonImpl mother = new PersonImpl();
OQLQuery query;
List persons;
mother.setFirstname("mom");
father.setFirstname("dad");
jimmy.setMother(mother);
jimmy.setFirstname("jimmy");
joe.setFather(father);
joe.setFirstname("joe");
Transaction tx = odmg.newTransaction();
tx.begin();
database.makePersistent(father);
database.makePersistent(mother);
database.makePersistent(jimmy);
database.makePersistent(joe);
tx.commit();
// read using id
tx = odmg.newTransaction();
tx.begin();
query = odmg.newOQLQuery();
query.create("select person from " + PersonImpl.class.getName() +
" where (mother.id=$1 or father.id=$2)");
query.bind(new Integer(mother.getId()));
query.bind(new Integer(father.getId()));
persons = (List) query.execute();
assertEquals(2, persons.size());
tx.commit();