db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Garulli" <l.garu...@orientechnologies.com>
Subject R: IN operator missed?
Date Mon, 13 Nov 2006 18:17:47 GMT
Hi,
Tested with JPOX and effectly works!

I'd had a look round in my memory, in the JPOX, Solarmetric documentation
and a fast look also in JDO spec, but I didn't find any use case like mine.

Thanks,
Bye Luca

-----Messaggio originale-----
Da: Erik Bengtson [mailto:erik@jpox.org] 
Inviato: lunedì 13 novembre 2006 18.14
A: 'JDO Expert Group'; jdo-dev@db.apache.org
Oggetto: Re: IN operator missed?

Why not? Have you tried with JPOX ?

Quoting Luca Garulli <l.garulli@orientechnologies.com>:

> Hi,
> Working in real-world applications using JDO 2.0 I beware about the 
> SQL IN equivalend operator missed by spec. An example:
>
> public class Questionnaire{
>   ...
>   private Employee employee;
>   ...
> }
>
> I'd like to get any Questionnaire instances for the following employee:
> Luca, Robert and Chris. The CONTAINS operator works only on 
> collection, but it could be useful to execute a query like this:
>
> List<Employee> list= new ArrayList<Employee>(); // LET'S THINK 
> E1-E2-E3 are loaded before List.add( e1 ); List.add( e2 ); List.add( 
> e3 );
>
> Query query = iManager.newQuery();
> query.setClass( Questionnaire.class ); query.setFilter( 
> "list.contains( employee )" ); query.declareVariables( 
> "java.util.Collection list" ); query.execute( list );
>
> JDO implementation should translate the query by using SQL IN operator 
> and the OID of Employee objects contained in the LIST collection 
> passed as parameter.
>
> What do you think?
>
> Bye,
> Luca Garulli
> CTO of Asset Data srl
> www.RomaFramework.org
>
>


Mime
View raw message