Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.3
Name and version of the database you are using: Mysql,
driver-3.1.10
I am using Middle gen to generate mapping files
(Just giving a simpler example, will provide mapping files if needed)
Tables
Quote:
Table AA
a - PK
a1
a2
Table BB
a - PK,FK(AA-a)
b - PK
b1
b2
Table CC
c - PK
c1
c2
Table ABC
a - PK,FK(BB-a)
b - PK,FK(BB-b)
c - PK,FK(CC-c)
abc1
abc2
Middlegen warningQuote:
1. There is a relation between ABC and BB that doesn't include all the primary key columns.
This may cause errors later on.
2. The BB table's primary key consists of 2 columns, but one of the relationships uses 1 foreign keys.
That is not a well-defined relationships, as all columns in a primary key (and only primary key columns)
should be referenced by a foreign key (all columns in the foreign key).
ExceptionQuote:
org.hibernate.MappingException: Foreign key (FK4E8A699D77159AE6:ABC [b])) must have same number of columns as the referenced primary key (BB [a,b])
It looks to me that the relation ships are all fine, any help would be greatly appreciated.
Thanks in advance.