2 Replies Latest reply on Dec 31, 2010 11:24 PM by Farhad Khan

    Deploying an ear project adds additional duplicate foreign key definitions to mysql database

    Farhad Khan Newbie
      Hi,
      I've been trying to debug this for a while now. We are trying to generate crud for a new application. Here's what we did and the error we're getting -

      1. Created database model with MySQL Workbench
      2. Generated a seam project and crud using "seam generate"
      3. Exploded the new project to jboss as

      Now,
      Before exploding, the database would have the foreign keys that were in the original database model
      fk_user_has_role_role1     BTREE     No     No     role_id     0     A     
      fk_user_has_role_host1     BTREE     No     No     host_id     0     A
      fk_user_has_role_user1     BTREE     No     No     user_id     0     A

      However, the moment I deploy the project to jboss, the database table appears to have  new foreign keys which are duplicates of the previous ones
      fk_user_has_role_role1     BTREE     No     No     role_id     0     A     
      fk_user_has_role_host1     BTREE     No     No     host_id     0     A
      fk_user_has_role_user1     BTREE     No     No     user_id     0     A
      FKC5444B93215F93DC     BTREE     No     No     host_id     0     A     
      FKC5444B9331F8F91C     BTREE     No     No     role_id     0     A     
      FKC5444B93D723BCFC     BTREE     No     No     user_id     0     A

      With the existence of additional foreign key definitions, the CRUD application fails to add an entry to the table.


      Any thoughts on why this is happening?

      Thanks,
      Farhad