I don’t know for sure if this will work with the current version of the hibernate assembler but it looks like it might.  I’ll explain how it ought to work at least.  Your AS code would look like:

 

taskDataService.fill(tasksArray, “tasksProjects”, [[1, 2, 3]]);

 

Since you are using positional parameters (not named parameters), you’d want to pass an array of parameters.  In this case, the first value in the array is itself an array of integers.  In Java, this array of integers should get turned into an Object[] containing Integer objects.  

 

We provide the source code to the hibernate assembler, so you can see that in the “fill” method of that class, we are calling:

 

                             query.setParameter(position, paramValue);

 

In this case, paramValue ought to be the Object[] above.  I am hoping that hibernate is smart enough to detect the array type and deal with it properly.  If not, you might need to modify the code… it looks like in the hibernate api they have query.setParameterList(“name”, Object[]) which might be a better variant to use to tell hibernate to expect the array parameter.   That seems to only exist for named parameters so you’d have to change your query to use “:name” instead of ? for your parameter.   

 

Jeff

 


From: [email protected] [mailto:[email protected]] On Behalf Of jonathan_merey
Sent: Thursday, November 02, 2006 8:53 AM
To: [email protected]
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