@Entity public class Book { @EmbeddedId private BookId id; private String genre; private Integer price; //standard getters and setters }