You need to have class with composit key fields , implementation of equals & hashcode method
And using that class as composit key with entity with @IdClass annotation.
@IdClass annotation is misssing with your entity.
This can be achieved by using either IdClass or Embeddable/EmbeddedId. Both are more or less same.
Let us all know what hapened after using IdClass or Embeddable.