org.hibernate.AnnotationException: A Foreign key refering ... from ... has the wrong number of columns

Solution Verified - Updated -

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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content