Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3445

DBRE having trouble with some oracle foreign keys

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3.RELEASE, 1.2.4.RELEASE
    • Fix Version/s: None
    • Component/s: @ ROO SHELL
    • Labels:
      None
    • Environment:
      Linux, Oracle 11G

      Description

      After importing the Oracle driver as an OSGI module I was able to reverse engineer databases without a problem until very recently. I have essentially encountered the exact same problem as the issue described in the URL. Basically, the roo dbre module is claiming that a "Foreign key table for foreign key" does not exist.

        Activity

        Hide
        chrismarx chris marx added a comment -

        This error is not a bug. You need to exclude any and all tables that have foreign keys to any of the tables you're reverse engineering.

        For instance, the solve this error (from the forum link):

        Foreign key table for foreign key 'FK_APLUSU_APLIC' in table 'ADMIN.TCOM_APLICACIONES' does not exist. One-to-one relationship not created

        Use the following sql (for oracle), to find the table that that foreign key deals with, and add it to the excluded tables list. I have to deal with an enormous oracle schema, and I liberally use * wildcard matching to exclude dozens of tables that have nothing to do with my project at hand.

        SELECT a.table_name, a.column_name, a.constraint_name, c.owner, 
               c.r_owner, c_pk.table_name r_table_name, c_pk.constraint_name r_pk
          FROM all_cons_columns a
          JOIN all_constraints c ON a.owner = c.owner
                                AND a.constraint_name = c.constraint_name
          JOIN all_constraints c_pk ON c.r_owner = c_pk.owner
                                   AND c.r_constraint_name = c_pk.constraint_name
         WHERE
               a.constraint_name like '%FK_APLUSU_APLIC%'
              

        Show
        chrismarx chris marx added a comment - This error is not a bug. You need to exclude any and all tables that have foreign keys to any of the tables you're reverse engineering. For instance, the solve this error (from the forum link): Foreign key table for foreign key 'FK_APLUSU_APLIC' in table 'ADMIN.TCOM_APLICACIONES' does not exist. One-to-one relationship not created Use the following sql (for oracle), to find the table that that foreign key deals with, and add it to the excluded tables list. I have to deal with an enormous oracle schema, and I liberally use * wildcard matching to exclude dozens of tables that have nothing to do with my project at hand. SELECT a.table_name, a.column_name, a.constraint_name, c.owner, c.r_owner, c_pk.table_name r_table_name, c_pk.constraint_name r_pk FROM all_cons_columns a JOIN all_constraints c ON a.owner = c.owner AND a.constraint_name = c.constraint_name JOIN all_constraints c_pk ON c.r_owner = c_pk.owner AND c.r_constraint_name = c_pk.constraint_name WHERE a.constraint_name like '%FK_APLUSU_APLIC%'

          People

          • Assignee:
            Unassigned
            Reporter:
            aeh Andrew
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: