title: How to use composite entity in spring-data-cassandra?
body: <p>I am setting up <code>spring-data-cassandra</code> for the first time and have a class like so:</p>
  
  <pre><code>@Table(value = "contact")
  public class Contact {
      @Id
      UUID id;
  
      ...
      Location Location;
      ...
  
      public void setLocation(Location location) {
          this.location = location;
      }
  
      public Location getLocation() {
          return location;
      }
  }
  </code></pre>
  
  <p>This gives me an error when starting up:</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySQLTransactionRepository': Invocation of init method failed; nested exception is org.springframework.data.cassandra.mapping.VerifierMappingExceptions: com.foo.backend.core.Location:
  Cassandra entities must have the @Table, @Persistent or @PrimaryKeyClass Annotation
  ....
  </code></pre>
  
  <p>Coming from a <code>spring-data-jpa</code> background simply annotating <code>Location</code> with <code>@Embeddable</code> has previously been enough. It looks like this doesn't work with <code>spring-data-cassandra</code>. <strong>How do I use compound entities with <code>spring-data-cassandra</code>?</strong></p>
  
  <p>Will have to annotate <code>location</code> as <code>@Transient</code> and do some serialization myself? I tried to annotate my class with <code>@Persistent</code> but was getting an error about <code>PrimaryKey</code> missing on <code>Location</code>. I can't comprehend why a primary key would be necessary...</p>