Let's define a very simple schema, and as we are using CQL, Cassandra isn't schema-less from a client perspective even if the data storage internally works slightly differently.
We can reuse the
RecipeService class from the previous chapter. We will just modify it slightly for our Cassandra integration. The original entity (and by virtue of using JPA) provides a basic table definition, which is as follows:
@Id @Column(nullable = false) private String title; @Column(length=10000) private String ingredients;
So, we have two fields in this table: an ID field named
title and a data field we call
ingredients for consistency and simplicity.