I am using Spring Boot 1.3 with Spring Data JPA. I want to use early primary key generation using a dedicated object for the primary key (as specified in Driven Driven Project Implementation ).
Suppose this object:
@Entity public class Book { @EmbeddedId private BookId id; }
and this value object:
@Embeddable public class BookId implements Serializable { private UUID id; protected BookId(){}
Then it works great. However, I want to create a superclass for all id classes, for example:
public class EntityUuidId implements Serializable { private UUID id; protected EntityUuidId(){}
Now the BookId class changes to:
@Embeddable public class BookId extends EntityUuidId { protected BookId(){}
The problem is that when launching my application, the following exception exists:
org.hibernate.AnnotationException: BookId has no persistent id property: Book.id
Why doesn't it suddenly work?
source share