Hi Luca, The specification does support the usage you mention. See below...
On Nov 13, 2006, at 7:29 AM, Luca Garulli wrote:
Hi,Working in real-world applications using JDO 2.0 I beware about the SQL INequivalend 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, butit 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" );
This should be query.declareParameters ("java.util.Collection list" );
query.execute( list );JDO implementation should translate the query by using SQL IN operator andthe OID of Employee objects contained in the LIST collection passed as parameter. What do you think?
I agree. We should add a test case for this in the TCK. Craig
Bye, Luca Garulli CTO of Asset Data srl www.RomaFramework.org
Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature