When I deploy my hibernate application in server getting below exception,
org.hibernate.MappingException: Foreign key (FK1E21AD3D33D6436848b1c6a0:DEBITCARD_SUBSCRIPTION [ORDERED_FROM])) must have same number of columns as the referenced primary key (BRANCH [UNIQUE_ID,INSTITUTION_ID])
But still unable to find out what is wrong with my mapping file.Please suggest!
By looking into your exceptions its clearly telling that the table DEBITCARD_SUBSCRIPTION contains a foreign key on a column named ORDERED_FROM, but your referenced table, BRANCH , defines it's primary key with two columns UNIQUE_ID and INSTITUTION_ID, which by the way is very common for relationship tables.
Well, if your domain model is really correct, then you need to think about how you want to synchronize your User's FK and GroupRole's PK. For that you might: