It seems like you did just that. Params passed in as an argument to the execute method. Params is an object array. I'm not where I can try this but since you are passing in a HashSet as an argument (which is an implementation of Set), I believe Xiawei Zhang's suggestion would be correct.
On Sat, Oct 14, 2017 at 2:04 AM, Xiawei Zhang <[email protected]> wrote: > out of my memory, it should be > > String queryString = "select key from /"+ dataRegionName+".entrySet where *key > in $1 *order by key"; > > > On Sat, 14 Oct 2017 at 1:16 AM, Parin dazz <[email protected]> wrote: > >> May be that's a missing feature! I was also struggling for the same. And >> wish to see support :) >> >> In my case, I have named query exactly similar to what you mentioned but >> with extra configuration parameter which informs my query engine that given >> named query accepts list/set as first position. >> >> Arguments may look like "1,2,3" as simple string though but later on >> based on extra information I supply my engine replaces $1 with 1,2,3 >> literal and appends it to same query. >> >> So it may become, >> select key from /XYZ.entrySet where key in set (1,2,3) order by key >> >> I have also maintained argument binding to take care of generic datatype >> of list/set. >> >> Regards, >> Dharam >> >> On Oct 13, 2017 22:36, "Xu, Nan" <[email protected]> wrote: >> >> Hi, >> >> >> >> For this query >> >> >> >> String queryString = "select key from /"+ dataRegionName+".entrySet where >> key in set ($1) order by key"; >> >> Object[] params = new Object[1]; >> >> params[0] = new HashSet<String>(keys); >> >> Query query = queryService.newQuery(queryString); >> >> SelectResults<String> result = (SelectResults<String>) >> query.execute(params); >> >> >> >> >> >> >> >> How do I bind the parameter? >> >> >> >> Put a set/list is not working >> >> >> >> Thanks, >> >> Nan >> >> >> >> >> ------------------------------ >> This message, and any attachments, is for the intended recipient(s) only, >> may contain information that is privileged, confidential and/or proprietary >> and subject to important terms and conditions available at >> http://www.bankofamerica.com/emaildisclaimer. If you are not the >> intended recipient, please delete this message. >> >> >> -- *Mark Secrist | Director, **Global Education Delivery* [email protected] 970.214.4567 Mobile *pivotal.io <http://www.pivotal.io/>* Follow Us: Twitter <http://www.twitter.com/pivotal> | LinkedIn <http://www.linkedin.com/company/pivotalsoftware> | Facebook <http://www.facebook.com/pivotalsoftware> | YouTube <http://www.youtube.com/gopivotal> | Google+ <https://plus.google.com/105320112436428794490>
