I think embedded primary key (TempPrimaryKey) should implements Serializable interface.
@Setter @Getter @Embeddable public class TempPrimaryKey implements Serilizable { // code }