@PrimaryKeyColumn annotations must have a type of PARTITIONED for scala Cassandra Spring Data application

Actually java bean properties not recognized other than annotations.

Scala does not bind instance variables as bean properties by default at case classes. For this you need to add @BeanProperty annotations to each properties.

import scala.beans.BeanProperty

@PrimaryKeyClass
case class SampleKey(@BeanProperty
                     @PrimaryKeyColumn(`type` = PrimaryKeyType.PARTITIONED, ordinal = 0, name = "id")
                     id: Int,
                     @BeanProperty
                     @PrimaryKeyColumn(`type` = PrimaryKeyType.CLUSTERED, ordinal = 1, name = "name")
                     name: String)

Also if you get an object construction error, add a constructor with default values (this requires to make variables var):

@PrimaryKeyClass
case class SampleKey(@BeanProperty
                     @PrimaryKeyColumn(`type` = PrimaryKeyType.PARTITIONED, ordinal = 0, name = "id")
                     var id: Int,
                     @BeanProperty
                     @PrimaryKeyColumn(`type` = PrimaryKeyType.CLUSTERED, ordinal = 1, name = "name")
                     var name: String) {
  def this() = this(0, "")
}

Hope this helps!