Here's an example when using Hibernate Named Queries.
 
If I defined the following query in pet.hbm.xml,
  <query name="owner.by.pet.name">select pet.owner from Pet as pet where pet.name=?</query>

Then my fill operation requires a single parameter to be supplied.  This is the value for the '?'.
 
petDataService.fill(petCollection, "owner.by.pet.name", ["Buddy"]);
 
 
In you're case, the query also has a single parameter.  In this case, you should pass in a value for 'in (?)'.  I'm not sure where the '*' comes in.
 
Perhaps the query should be <query name="taskProjects">select * From Task where idProject in (?, ?, ?)</query>
In which case, the fill would be taskDataService.fill(tasksArray, "tasksProjects", [1, 2, 3]);
 
Which should resolve to 'select * From Task where idProject in (1, 2, 3)'
that is
  Query q2 =  s.getNamedQuery("taskProjects");
  q2.setInt(0, 1);  // where the first parameter is the position of the ? and the second parameters it the value passed in
  q2.setInt(1, 2);
  q2.setInt(2, 3);
 
- Cathy


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jonathan_merey
Sent: Thursday, November 02, 2006 11:53 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] FDS Method Fill and List of parameters

Hi,

I put this request in my mapping :

<query name="tasksProjects">From Task where idProject in (?)</query>

I want to know how put in this call method to replace * :

taskDataService.fill(tasksArray, "tasksProjects", [*]);

The request must be like that :

select * From Task where idProject in (1, 2, 3)

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to