I have a table where there isn't a primary key. It is expecting an @ID
annotation and without it, the following error is being thrown:
Caused by: org.hibernate.AnnotationException: No identifier specified for entity:
overall.model.Overall
at org.hibernate.cfg.InheritanceState.determineDefaultAccessType(InheritanceState.java:266) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final]
at org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:211) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final]
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:781) ~[hibernate-core-5.4.17.Final.jar:5.4.17.Final]
I have tried implementing both in JDBC template as well as using JPA
but I'm not able to create any entity without @ID
annotation.
The table has all fields of type String. Could you please give a suggestion on how to configure a table to not have a primary key?
I am using a spring-boot
.