I\'m trying to query a Cassandra table using the IN clause and the @Query annotation from Spring Data. I have a table with a partition key of last_name and a clustering key
It seems to be not possible!
I checked the source code of spring-data-cassandra-1.3.2.RELEASE.jar.
The allowed data types of parameter in the query method are
String.class, CharSequence.class, char.class, Character.class, char[].class, long.class, Long.class, boolean.class, Boolean.class, BigDecimal.class, BigInteger.class, double.class, Double.class, float.class, Float.class, InetAddress.class, Date.class, UUID.class, int.class are Integer.class.
They can be found in
org.springframework.data.cassandra.repository.query.CassandraQueryMethod.ALLOWED_PARAMETER_TYPES = Collections.unmodifiableList(Arrays
.asList(new Class>[] { String.class, CharSequence.class, char.class, Character.class, char[].class, long.class,
Long.class, boolean.class, Boolean.class, BigDecimal.class, BigInteger.class, double.class, Double.class,
float.class, Float.class, InetAddress.class, Date.class, UUID.class, int.class, Integer.class }));
If we pass data types other than these, then org.springframework.data.cassandra.repository.query.CassandraQueryMethod.verify(Method method, RepositoryMetadata metadata) will throw IllegalArgumentException.