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 "Stark, Roman" <st...@indiana.edu> on 2004/11/23 22:05:22 UTC

Sub query use with Criteria.PARENT_QUERY_PREFIX

Hi All

I am still struggling with the sub query feature and the use of the
subCrit.addEqualToField("productGroupId",Criteria.PARENT_QUERY _PREFIX +
"groupId");

Has anyone used this successfully and if so would you mind sharing some
of your experience and a code snippet please.  

I have been trying to use it on a query where the enclosing and sub
query both use the same table. Maybe that is a problem.   Any
suggestions would be great.

Thanks
Roman

Re: Sub query use with Criteria.PARENT_QUERY_PREFIX

Posted by Gene <ge...@yahoo.com>.
Stark, Roman <starkr <at> indiana.edu> writes:

> 
> Hi All
> 
> I am still struggling with the sub query feature and the use of the
> subCrit.addEqualToField("productGroupId",Criteria.PARENT_QUERY _PREFIX +
> "groupId");
> 
> Has anyone used this successfully and if so would you mind sharing some
> of your experience and a code snippet please.  
> 
> I have been trying to use it on a query where the enclosing and sub
> query both use the same table. Maybe that is a problem.   Any
> suggestions would be great.
> 
> Thanks
> Roman
> 

Hi, Roman,

Please turn on SQL logging switch to see what's the SQL output in spy.log file
when you execute the Query. I have ever run successfully a Query with subQuery,
which take the form like mainCrit.addIn("sampleField", subQuery). Certainly you
can also take a try of addIn() method.

Gene




---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org