org.hibernate.AnnotationException: SecondaryTable JoinColumn cannot reference a non primary key

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via atlassian.net by Unknown author, 2 years ago
SecondaryTable JoinColumn cannot reference a non primary key
via Hibernate JIRA by krokodylowy, 1 year ago
via Hibernate JIRA by Krashan Brahmanjara, 1 year ago
via Stack Overflow by Juriy
, 2 years ago
SecondaryTable JoinColumn cannot reference a non primary key
via Stack Overflow by zx_wing
, 2 years ago
SecondaryTable JoinColumn cannot reference a non primary key
via Oracle Community by 807605, 3 months ago
A Foreign key refering net.tss.app.ejb.entities.
org.hibernate.AnnotationException: SecondaryTable JoinColumn cannot reference a non primary key
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:243)
at org.hibernate.cfg.annotations.EntityBinder.bindJoinToPersistentClass(EntityBinder.java:520)
at org.hibernate.cfg.annotations.EntityBinder.createPrimaryColumnsToSecondaryTable(EntityBinder.java:510)
at org.hibernate.cfg.annotations.EntityBinder.finalSecondaryTableBinding(EntityBinder.java:441)
at org.hibernate.cfg.SecondaryTableSecondPass.doSecondPass(SecondaryTableSecondPass.java:25)

Users with the same issue

2 times, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.