Materialized-View-Mapping

Achilles supports the new Cassandra 3.0 materialized view feature. To mark an entity as
a materialized view, you can use the @MaterializedView annotation.


    @Table(table = "user")
    public class UserEntity {
        ...
    }
    @MaterializedView(baseEntity = UserEntity.class, view = "user_by_country")
    public class UserByCountryView {
    
    }
    

The @MaterializedView annotation defines 3 attributes:



A materialized view must comply to some rules:

Failing one of these rules will trigger a compilation error.

Furthermore, since only read operations are allowed on a materialized view, the generated manager for the view has a
restricted API:

For raw().nativeQuery(...), a runtime check is performed on the provided statement to ensure it is a SELECT statement