http://worg.hibernate.MappingException: Foreign key (FK79D994BA24E43F9A:BILLING_COMPONENT [SALARY_ACCOUNT_NO])) must have same number of columns as the referenced primary key (VENDOR_ACCOUNT [VENDOR_ID,SALARY_ACCOUNT_NO])
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:86)
at org.hibernate.mapping.ForeignKey.setReferencedTable(ForeignKey.java:51)
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:940)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:888)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1036)ww.hibernate.org/ForumMailinglists/HowToAskForHelp
Hi Guyz,
I have been trying 2 solve the above error for quite some time......I have 3 Table "Billing_Component","vendor" & "Vendor_Account".
The Primary key in "Vendor" is "VENDOR_ID"..Which in turn is a foreign key in both "Billing_Component" & "Vendor_Account".
In other words....."vendor" has a many-to-one relation with "Vendor" & a one-to-many with "Billing_Component".
"Billing_Component" table also has a many-to-one with "vendor".
Now when I generate the HBMS for all this tables......& try to start my tomcat....The above stated error is generated.
The many-to-one mapping for "Vendor_Account" in "Billing_Component"...mentions only the COLUMN "SALARY_ACCOUNT_NO".....Hence this prob...If I explicitly mention COLUMN "VENDOR_ID" ..Then this prob is solved but I get the "Duplication column exception-put insert="false" & update="false" in Billing_Component table.
I read some where this is a Bug....Any solutions???