Using cassandra-quarkus-mapper-processor with IN-query

Viewed 96

How can I use the Quarkus mapper processor with a query with IN

I would like to do a select with two IN, but I always get:

com.datastax.oss.driver.api.core.type.codec.CodecNotFoundException: Codec not found for requested operation: [INT <-> java.util.List<java.lang.Integer>]

When I select for just a single column_two and column_three it works fine, and I also can run the query directly on the database without problems.

Example:

@Select(customWhereClause = "column_one = :columnOne AND column_two IN (:columnTwoList) AND column_three IN (:columnThree)")
MutinyMappedReactiveResultSet<NotificationRecord> findByIds(Integer columnOne, List<Integer> columnTwoList, List<Integer> columnThree);
1 Answers

Binding declaration looks incorrect - instead of IN (:columnThree) try IN :columnThree. This happens because when you bind as IN (:columnThree) it expects that columnThree is one element inside the list, not the full list.

Related