You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Kohlweiss Georg <Ge...@oekb.at> on 2004/09/21 21:03:26 UTC
please help with user aliases!
dear savior!
i just wrote a mail message concerning user aliases
http://www.mail-archive.com/ojb-user%40db.apache.org/msg11359.html
maybe it was a bit confusing, so let me extract the important things out of my message:
Here is an example, it may seem a little strange to you, but there exists a circle-reference, that means class B has two separate references to class A:
class relation class relation class
A 1 ---- m B m ---- 1 A
collection-descriptors for A: allB1s, allB2s
reference-descriptors for B: refA1, refA2
pseudo-code:
-------
Criteria critA1
critA1.setAlias("a1", "allB1s");
critA1.addEqualTo("allB1s.fieldB1", obj1);
Criteria critB1
critB1.setAlias("b1", "allB2s");
critB1.addEqualTo("allB1s.refA1.allB2s.fieldB1", objB1);
critB1.addEqualTo("allB1s.refA1.allB2s.fieldB2", objB2);
Criteria critB2
critB2.setAlias("b2", "allB2s");
critB2.addEqualTo("allB1s.refA1.allB2s.fieldB1", objB3);
critB2.addEqualTo("allB1s.refA1.allB2s.fieldB2", objB4);
critA1.addAndCriteria(critB1);
critA1.addAndCriteria(critB2);
QueryByCriteria(A.class, critA1);
--------
What I get is this:
A--B
--B--A--B
--B
How can I ensure that OJB (1.0.1) produces a join path like the following:
A--B--A--B
--B
please help, it's really important!
thanks!
georg
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org