Spring Roo
  1. Spring Roo
  2. ROO-3300

Add automaticallyDelete option to DBRE command so that it can be set to false when calling the command

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2.RELEASE
    • Fix Version/s: None
    • Component/s: @ ROO SHELL
    • Labels:
      None
    • Environment:
      OSX Mountain Lion

      Description

      I'm currently working on a multi module project where I want to run DBRE within each module to reverse engineer specific tables into each module. When I run DBRE in the first module with the --includeTables option set to the tables I want in that module, it works. When I then focus to the next module and run DBRE again within that module and specify the tables I want in this module using --includeTables, those are the only entities generated, however all the entities and ITDs created in the first module get deleted.

      I did a test where after running DBRE in one module, I updated the automaticallyDelete option to false in the @RooDbManaged annotation on one particular entity. Then from within another project module, I ran DBRE on it's respective tables and the one entity from the previous module remained since automaticallyDelete was set to false.

      So to summarize, if we could set automaticallyDelete to false right in the DBRE command, this would save a lot of time when developing multi module apps where the database may only need to be reverse engineered once for most if not all tables.

        Activity

        Hide
        Patrick Grimard added a comment -

        Upon further investigation, simply adding the automaticallyDelete option to the DBRE command won't work. When I manually set this attribute to false on my entity classes, the DBManaged ITDs were subsequently deleted and they contained all the field members for the entity. A better option I think if DBRE only needs to occur once would be to have an option on the DBRE command like "--dbManaged false" where instead of creating a DBManaged ITD and annotating the entity class, the code would just be generated directly in the entity class and no DBManaged ITD would be created, nor would the entity be annotated with the @RooDbManaged annotation.

        Show
        Patrick Grimard added a comment - Upon further investigation, simply adding the automaticallyDelete option to the DBRE command won't work. When I manually set this attribute to false on my entity classes, the DBManaged ITDs were subsequently deleted and they contained all the field members for the entity. A better option I think if DBRE only needs to occur once would be to have an option on the DBRE command like "--dbManaged false" where instead of creating a DBManaged ITD and annotating the entity class, the code would just be generated directly in the entity class and no DBManaged ITD would be created, nor would the entity be annotated with the @RooDbManaged annotation.

          People

          • Assignee:
            Unassigned
            Reporter:
            Patrick Grimard
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: