Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: dbre mysql 'Foreign key table for foreign key' 'must not be null'

  1. #21

    Default Again and again

    Each time I need to do a reverse engineering I face the same problem ...

    But this time I didn't manage to solve it just by restarting SpringRoo ...

    When I try to do my reerse engineering, I always have this error :
    Foreign key table for foreign key X in table Y must not be null in determining a one-to-one relationship
    Please, can anyone tell me where does this error come from ?

  2. #22
    Join Date
    Dec 2005
    Posts
    929

    Default

    This warning is displayed if you have foreign key relationships but have restricted the tables reverse engineered with either the --includeTables or --excludeTables options. if your database has all the correct FK relationships you should not see this problem.
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #23

    Default

    Hello Alan,

    I didn't have restricted the tables reversed ... here is my command :
    roo> database reverse engineer --schema mySchema --package com.compagny.project.bo
    EDIT: I found a way to solve my problem :
    I work in the schema S. I have some tables that belongs to differents schemata. I create copies of those tables structure into S and connected the PK/FK to those copies. Then I do the reverse engineering without trouble.
    Then I re-link the PK/FK to the original tables and delete the copies.
    Last edited by Cedric.Vidrequin; Sep 19th, 2011 at 07:40 AM.

  4. #24
    Join Date
    Dec 2005
    Posts
    929

    Default

    In 1.2.0.M1, DBRE supports multiple schemas. Try:

    Code:
    database reverse engineer --schema "schema1 schema2" --package com.compagny.project.bo
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  5. #25

    Default

    Thank you for the clue Alan !

    I'll try this next time

  6. #26

    Default

    Hello again Alan,

    I thought about what you proposed before ... If I add several schemata in the command, I suppose the reverse engineering will generate all the BO of all the tables of all the schemata, won't it ?

    Well, I'd like it to generate only a few of them in schema2 and all of them in schema1 (for example).

    Do you know if it is possible without specifying all the expected table (they are numurous on schema1 and only few on schema2).

  7. #27
    Join Date
    Dec 2005
    Posts
    929

    Default

    You can still use the --includeTables and --excludeTables options, however they are not schema specific, so if a table called "foo" exists in both schemas, both will either be included or excluded depending on what option(s) you specify
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  8. #28

    Default

    Unfortunatly, it seems it is not possible to do something like this :
    database reverse engineer --schema "schema1 schema2" --package com.compagny.project.bo --includeTable schema2.class1 schema2.class2
    The problem for me is that there are a lot of tables in schema1, a lot of table in schema2, and I need all the tables of schema1 and only few of schema2 ... so if I have to include/exclude all the expected tables, I'll have to write a huuuuudge list ...

    Anyway, thanks for attention and clues

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •