Spring Roo
  1. Spring Roo
  2. ROO-3231

database reverse engineer --activeRecord "false" clobbers --activeRecord "true" option

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Works as Designed
    • Affects Version/s: 1.2.2.RELEASE
    • Fix Version/s: None
    • Component/s: None

      Description

      First run "database reverse engineer --activeRecord "false"

      Then run "database reverse engineer" or "database reverse engineer --activeRecord "true"

      The --activeRecord "true" will be silently ignored, meaning the @RooActive record annotation will not be applied.

        Activity

        Hide
        Alan Stewart added a comment - - edited

        DBRE is incremental in its operation. If there were no schema changes in your database, then upon subsequent running of the comamnd the dbre.xml will not be updated which in turn will not trigger any changes to your model. If you added a new table for example, and speciified true fo active record, then the new object will be generated as an active record entity, otherwise it will leave existing entities unchanged.

        Show
        Alan Stewart added a comment - - edited DBRE is incremental in its operation. If there were no schema changes in your database, then upon subsequent running of the comamnd the dbre.xml will not be updated which in turn will not trigger any changes to your model. If you added a new table for example, and speciified true fo active record, then the new object will be generated as an active record entity, otherwise it will leave existing entities unchanged.
        Hide
        Gregory J Soulsby added a comment -

        Alan,

        Now I am really confused.

        "DBRE is incremental in its operation" - this is not what I am seeing, at least in terms of my understanding of what incremental would mean.

        I will attach a backup of a test app and the Roo output below.

        You will see

        database reverse engineer --includeTables "A"
        database reverse engineer --includeTables "B"

        where the second command deletes table A

        In the output there is a line "Deleted A.java - no database table called 'A'", which would be the cause.

        Any help greatly appreciated!

        Environment:

        • STS3.0.0, but same behaviour in 2.
        • Ubuntu 12.04 LTS
        • 64 bit

        / , _/ // / /_/ /
        // ||___/___/ 1.2.2.RELEASE [rev 7d75659]

        Welcome to Spring Roo. For assistance press CTRL+SPACE or type "hint" then hit ENTER.
        roo> osgi start --url file:///home/greg/.m2/repository/mysql/mysql-connector-java/5.1.18/mysql-connector-java-5.1.18.jar
        roo> jpa setup --database MYSQL --provider HIBERNATE --databaseName upcaseco_innove --userName xxxx --password yyyy
        Created SPRING_CONFIG_ROOT/database.properties
        Please update your database details in src/main/resources/META-INF/spring/database.properties.
        Updated SPRING_CONFIG_ROOT/applicationContext.xml
        Created SRC_MAIN_RESOURCES/META-INF/persistence.xml
        Updated ROOT/pom.xml [added dependencies mysql:mysql-connector-java:5.1.18, org.hibernate:hibernate-core:3.6.9.Final, org.hibernate:hibernate-entitymanager:3.6.9.Final, org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final, commons-collections:commons-collections:3.2.1, org.hibernate:hibernate-validator:4.2.0.Final, javax.validation:validation-api:1.0.0.GA, cglib:cglib-nodep:2.2.2, javax.transaction:jta:1.1, org.springframework:spring-jdbc:$

        {spring.version}, org.springframework:spring-orm:${spring.version}

        , commons-pool:commons-pool:1.5.6, commons-dbcp:commons-dbcp:1.3]
        roo> database reverse engineer --schema no-schema-required --package ~.domain --includeTables "aaa_rels" --activeRecord "true"
        Created SRC_MAIN_RESOURCES/dbre.xml
        Updated ROOT/pom.xml
        Updated SRC_MAIN_RESOURCES/META-INF/persistence.xml
        Created SRC_MAIN_JAVA/com/ibp/t002/domain
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK.java
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels.java
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Json.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Serializable.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Configurable.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Identifier.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Configurable.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Jpa_ActiveRecord.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_ToString.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Jpa_Entity.aj
        roo> database reverse engineer --schema no-schema-required --package ~.domain --includeTables "aaa_import_authorities" --activeRecord "true"
        Updated SRC_MAIN_RESOURCES/dbre.xml
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels.java - no database table called 'aaa_rels'
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK.java - managed identifier of deleted type com.ibp.t002.domain.AaaRels
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK.java
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities.java
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK_Roo_Json.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK_Roo_Serializable.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK_Roo_Configurable.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK_Roo_Identifier.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities_Roo_Configurable.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities_Roo_Jpa_ActiveRecord.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities_Roo_ToString.aj
        Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities_Roo_Jpa_Entity.aj
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_ToString.aj - AaaRels.java not found
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Jpa_Entity.aj - AaaRels.java not found
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Jpa_ActiveRecord.aj - AaaRels.java not found
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Configurable.aj - AaaRels.java not found
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Serializable.aj - AaaRelsPK.java not found
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Json.aj - AaaRelsPK.java not found
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Identifier.aj - AaaRelsPK.java not found
        Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Configurable.aj - AaaRelsPK.java not found
        roo>

        Show
        Gregory J Soulsby added a comment - Alan, Now I am really confused. "DBRE is incremental in its operation" - this is not what I am seeing, at least in terms of my understanding of what incremental would mean. I will attach a backup of a test app and the Roo output below. You will see database reverse engineer --includeTables "A" database reverse engineer --includeTables "B" where the second command deletes table A In the output there is a line "Deleted A.java - no database table called 'A'", which would be the cause. Any help greatly appreciated! Environment: STS3.0.0, but same behaviour in 2. Ubuntu 12.04 LTS 64 bit / , _/ / / / /_/ / / / | |___ /_ __/ 1.2.2.RELEASE [rev 7d75659] Welcome to Spring Roo. For assistance press CTRL+SPACE or type "hint" then hit ENTER. roo> osgi start --url file:///home/greg/.m2/repository/mysql/mysql-connector-java/5.1.18/mysql-connector-java-5.1.18.jar roo> jpa setup --database MYSQL --provider HIBERNATE --databaseName upcaseco_innove --userName xxxx --password yyyy Created SPRING_CONFIG_ROOT/database.properties Please update your database details in src/main/resources/META-INF/spring/database.properties. Updated SPRING_CONFIG_ROOT/applicationContext.xml Created SRC_MAIN_RESOURCES/META-INF/persistence.xml Updated ROOT/pom.xml [added dependencies mysql:mysql-connector-java:5.1.18, org.hibernate:hibernate-core:3.6.9.Final, org.hibernate:hibernate-entitymanager:3.6.9.Final, org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final, commons-collections:commons-collections:3.2.1, org.hibernate:hibernate-validator:4.2.0.Final, javax.validation:validation-api:1.0.0.GA, cglib:cglib-nodep:2.2.2, javax.transaction:jta:1.1, org.springframework:spring-jdbc:$ {spring.version}, org.springframework:spring-orm:${spring.version} , commons-pool:commons-pool:1.5.6, commons-dbcp:commons-dbcp:1.3] roo> database reverse engineer --schema no-schema-required --package ~.domain --includeTables "aaa_rels" --activeRecord "true" Created SRC_MAIN_RESOURCES/dbre.xml Updated ROOT/pom.xml Updated SRC_MAIN_RESOURCES/META-INF/persistence.xml Created SRC_MAIN_JAVA/com/ibp/t002/domain Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK.java Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels.java Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Json.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Serializable.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Configurable.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Identifier.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Configurable.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Jpa_ActiveRecord.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_ToString.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Jpa_Entity.aj roo> database reverse engineer --schema no-schema-required --package ~.domain --includeTables "aaa_import_authorities" --activeRecord "true" Updated SRC_MAIN_RESOURCES/dbre.xml Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels.java - no database table called 'aaa_rels' Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK.java - managed identifier of deleted type com.ibp.t002.domain.AaaRels Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK.java Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities.java Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK_Roo_Json.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK_Roo_Serializable.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK_Roo_Configurable.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthoritiesPK_Roo_Identifier.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities_Roo_Configurable.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities_Roo_Jpa_ActiveRecord.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities_Roo_ToString.aj Created SRC_MAIN_JAVA/com/ibp/t002/domain/AaaImportAuthorities_Roo_Jpa_Entity.aj Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_ToString.aj - AaaRels.java not found Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Jpa_Entity.aj - AaaRels.java not found Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Jpa_ActiveRecord.aj - AaaRels.java not found Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRels_Roo_Configurable.aj - AaaRels.java not found Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Serializable.aj - AaaRelsPK.java not found Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Json.aj - AaaRelsPK.java not found Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Identifier.aj - AaaRelsPK.java not found Deleted SRC_MAIN_JAVA/com/ibp/t002/domain/AaaRelsPK_Roo_Configurable.aj - AaaRelsPK.java not found roo>
        Hide
        Gregory J Soulsby added a comment -

        backup for project showing non incremental behaviour

        Show
        Gregory J Soulsby added a comment - backup for project showing non incremental behaviour

          People

          • Assignee:
            Alan Stewart
            Reporter:
            Gregory J Soulsby
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: