java - How to use IN clause in Spring data Cassandra -


this question has answer here:

i'm trying query cassandra table using in clause , @query annotation spring data

my query in init method-

     session = cassandrasessionfactory.getsession();      statementmylist = session.prepare("select * my_file_content my_content in (?);"); 

tried bind query boundstatement-

  final boundstatement boundstatement = daoconstants.getboundstatement(statementmylist);    try   {    list<row> rowlist =       session           .execute(               boundstatement                   .bind(mylist))           .all();            // mylist = "'04748558-0eb3','531aaf2bf6b782f95e2e','6fc98ac2'"       } 

rowlist returns empty array. doing wrong here?

the problem don't need parenthesis if binding full list, should be:

session = cassandrasessionfactory.getsession(); statementmylist = session.prepare("select * my_file_content my_content in ?;"); 

(?) work if providing single value, want ? if providing collection.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -