java - How to use spring Repository without @Id? - Stack Overflow
PA requires that every entity has an ID. So no, entity w/o an ID is not allowed.
Every JPA entity must have a primary key.
from JPA spec
You may want to read more about how JPA handles a case when there's no id on the DB side from here (see 'No Primary Key').
Read full article from java - How to use spring Repository without @Id? - Stack Overflow
No comments:
Post a Comment