Results 1 to 3 of 3

Thread: DBRE : Changing package of reverse engineering

  1. #1
    Join Date
    Feb 2012
    Posts
    3

    Question DBRE : Changing package of reverse engineering

    Hi,

    Is it possible to change the target package of the reverse engineering command once it has been called once ?
    It looks like once it has been issued with one package, it ignores all subsequent package options.

    Reproducing steps :

    Code:
    roo> database reverse engineer --schema test-error --package ~.domain
    Created SRC_MAIN_RESOURCES\dbre.xml
    Updated ROOT\pom.xml
    Updated SRC_MAIN_RESOURCES\META-INF\persistence.xml
    Created SRC_MAIN_JAVA\com\company\app\domain
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK.java
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithComment.java
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Json.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Serializable.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Configurable.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Identifier.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_Configurable.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_Jpa_ActiveRecord.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_ToString.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_Jpa_Entity.aj
    I then delete all entity java files by hand. Roo picks it up and delete all corresponding files :

    Code:
    Deleted SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_ToString.aj - TableWithComment.java not found
    Deleted SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_Jpa_Entity.aj - TableWithComment.java not found
    Deleted SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_Jpa_ActiveRecord.aj - TableWithComment.java not found
    Deleted SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_Configurable.aj - TableWithComment.java not found
    Deleted SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Serializable.aj - TableWithCommentPK.java not found
    Deleted SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Json.aj - TableWithCommentPK.java not found
    Deleted SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Identifier.aj - TableWithCommentPK.java not found
    Deleted SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Configurable.aj - TableWithCommentPK.java not found
    Then if I reverse to another package, files are not created in the proper package :

    Code:
    roo> database reverse engineer --schema test-error --package ~.other.domain
    Created SRC_MAIN_RESOURCES\dbre.xml
    Created SRC_MAIN_JAVA\com\company\app\domain
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK.java
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithComment.java
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Json.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Serializable.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Configurable.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithCommentPK_Roo_Identifier.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_Configurable.aj
    Created SRC_MAIN_JAVA\com\company\app\domain\TableWithComment_Roo_ToString.aj
    Am I missing something here ?

    Thanks !

  2. #2
    Join Date
    Dec 2005
    Posts
    935

    Default

    Existing entities will not change locations, however if new tables are added, these will be put into the subsequent --package you specify.
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3
    Join Date
    Feb 2012
    Posts
    3

    Default

    Thanks for answering me !

    The thing is : I just deleted the said entities so to me roo should not consider them as "existing"...

    So if I made a mistake in the package, or just want to refactor the entities package, I have no other solution than recreating a new project with the new packaging policy ? That's what I actually had to do for a project.

    As a more general question, does roo hold/store some information somewhere else than in the actual java/aj file ?

    thanks

Tags for this Thread

Posting Permissions

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