Hi all!
I would like to ask to you a question...
Suppose that my schema is composed by three table: T1(a,b) where a is the
primary key, T2(c,d) where c is the primary key, and a bridging table
T1_T2(a,c) because between T1 and T2 there is a many-to-many relation.
I would perform the following query:
select T1.a, T1.b, T2.c, T2.d
from T1,T1_T2,T2
where T1.a =
T1-T2.a
With the Criteria objects, it is possible to code the above query as follow:
Criteria criteria = new Criteria();
criteria.addJoin(T1Peer.a,T1_T2Peer.a);
criteria.addJoin(T1_T2Peer.c, T2Peer.c);
And now??
Observe that I need the value of fields of BOTH T1 and T2.
If I wanted only the fields in T2, then I would call the doSelect method as
follow: List l = T2Peer.doSelect(criteria).
Concluding, the question is : is it possible perform a query whose resulting
columns are the union (or a subset of the union) of columns of the tables
involved in the query?
I read the documentation but I didn't find a way to do this.....
Thank you in advance,
Antonio Iossa.
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Trova e confronta il cellulare pi� adatto a te! Clicca qui
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2836&d=7-10
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]