Reputation: 922
Updated Cassandra driver core jar to version 2.2.0-rc1 from 2.1.7. I have a statement like :
Statement select = QueryBuilder.select().all().from(keyspace, tableName).where(QueryBuilder.contains("tags", list.get(0)));
Cannot find QueryBuilder.contains. Do we now have some alternative for contains clause? How to use contains for new updated driver?
Upvotes: 1
Views: 484
Reputation: 11638
Java Driver 2.2+ no longer provides static methods for QueryBuilder for creating queries. Instead you now must construct a QueryBuilder instance providing a Cluster instance, i.e.:
Statement select = new QueryBuilder(cluster).select().all().from(keyspace, tableName).where(QueryBuilder.contains("tags", list.get(0)));
There has been discussion that providing the Cluster instance may not always be required (it's mainly useful for determining key routing and value serialization), so this may change back to the way it exists in java-driver 2.1.
The contains method still remains static as it is part of query criteria, but not for constructing the beginning of the query (i.e. select, delete, etc.).
Upvotes: 1