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

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -