I'm using the Datastax Java Driver Mapper. The Doc and Github describe the possibility of using the @Select annotation with no parameters to select all rows within a table.
https://docs.datastax.com/en/developer/java-driver/4.4/manual/mapper/daos/select/
https://github.com/datastax/java-driver/pull/1285
So I did the following:
@Dao
public interface SchaduleJobDao {
(...)
@Select
@StatementAttributes (consistencyLevel = "LOCAL_QUORUM")
PagingIterable<ScheduleJobEntity> all();
(..)
However, an error is raised by Eclipse in the all() method line:
"Invalid parameter list: Select methods that don't use a custom clause must take the partition key components in the exact order (expected PK of ScheduleJobEntity: [java.lang.String])"
According to the references above, it should be allowed.
I did check the version, and prior 4.2 this feature should be working, I'm using the 4.4. So it doesn't seem to be version related. My pom file:
<dependency>
<groupId>com.datastax.oss</groupId>
<artifactId>java-driver-mapper-processor</artifactId>
<version>4.4.0</version>
</dependency>
What I may be doing wrong? Is where a way to solve this?
Thanks
I think this might be a configuration issue. Could you check that your POM doesn't reference an older version of the processor in another place? In particular, another way to provide it is in the annotationProcessorPaths
section of the compiler plugin, as shown here.
We have an integration test that covers this case and I just double-checked that it passes in 4.4.0. Also, the error message slightly changed after we introduced the feature, it used to say "must take the partition key components", now it says "must match"; you're quoting the old message.