org.hibernate.AnnotationException: A Foreign key refering ... from ... has the wrong number of columns
Issue
- Using composite identifiers and mapping an association between two entities
- Encountering errors while initializing/loading the Hibernate schema like the below:
org.hibernate.AnnotationException: A Foreign key refering test.MyPKEntity from test.MyFKEntity has the wrong number of column. should be 2
Environment
- Red Hat JBoss Enteprise Application Platform (EAP)
- 4
- 5
- 6
- Hibernate
- 3
- 4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
