RE: Subselects in Torque 3.3rc2

Thomas Fischer <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.torque.user
Message-ID <OFA07308AC.D315C7D5-ONC12574AA.005CDD59-C12574AA.005D4A46@seitenbau.net>
Markus Daniel <[email protected]> schrieb am 19.08.2008 14:45:06:

> I am looking for a possibility to make a subselect like:
> ------------
>  select name from resource where id in
>  (select id from resource_postalcode_rel where postalcode_id in
>   (select id from postalcode where postalcode.city_name like '%76%'
>     or postalcode like '%76%'))
> ------------
> by criteria/criterion.
> I have found this
> 
http://www.mail-archive.com/turbine-user%40jakarta.apache.org/msg03764.html

> 
> I hope there is an other option than using the custom modifier.
> 
> Can anybody tell me?

Subselects were added somewhere in the 3.3 dev cycle. No idea whether 
3.3-RC2 already had it. Check the change logs.
You can activate it by adding the subselect criteria to the outer 
criteria.
 
> I also found "doSelectJoin<tablename>" but this is only half of what I
> need. Maybe it is an idea to reimplement a
> doSelectJoin<firstTablename_secondTablename>-Method.
> 
> Is this an option and a good idea?

If you need it often, why not. You can write it yourself or autogenerate 
it by modifying the templates.

Check the generated code for the doSelectJoin<tablename> method, you 
should get the idea pretty fast.

    Thomas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.