I have a cassandra table with an associated materialized view.
The primary key is a single id of type uuid, and I have no sort key. Let's call it my_table_id
. This table contains a related_id
that I want to use to search.
Then I have a materialized view for that table defined as
PRIMARY KEY (related_id, my_table_id) WITH CLUSTERING ORDER BY (my_table_id ASC)
PS: I realise it's the wrong way to partition data in Cassandra, but unfortunately, this code was inherited.
I'm defining my table in my java code as:
@Table(table = "my_table")
public class MyTableType {
@PartitionKey
@Column("my_table_id")
@Codec(MyIdCassandraConverter.class)
CustomUUIDType myTableId;
@Column("related_id")
@Codec(MyRelatedIdCassandraConverter.class)
MyRelatedId relatedId;
(...)
}
Those two custom types are simply wrappers around UUIDs. Again, inherited.
My materialized view is defined as:
@MaterializedView(baseEntity = MyTableType.class, view = "my_table_by_related_id")
public class MyTableTypeByRelatedId {
@PartitionKey
@Column("related_id")
@Codec(MyRelatedIdCassandraConverter.class)
MyRelatedId relatedId;
@ClusteringColumn
@Column("my_table_id")
@Codec(MyIdCassandraConverter.class)
CustomUUIDType myTableId;
}
The code seems to be generated correctly, but when I start my Spring Boot application, I get:
Error:java: Cannot find base entity class 'mypackage.MyTableType' for view class 'mypackage.MyTableTypeByRelatedId' Error:java: Error while parsing: Cannot find base entity class 'mypackage.MyTableType' for view class 'mypackage.MyTableTypeByRelatedId'
There's some code generation going on, so it seems to be something's not generated correctly, but I can't quite figure out what.
The only mildly useful documentation I find is here and here, but none seems to offer help.
What am I doing wrong?