Spring Roo
  1. Spring Roo
  2. ROO-1771

If possible DBRE addon shouldn't write catalog value in generated model

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.0.RELEASE
    • Fix Version/s: 1.1.1.RELEASE
    • Component/s: PERSISTENCE
    • Labels:
      None
    • Environment:
      roo 1.1.1 jdk 1.6 nysql 5.1

      Description

      when I do database reverse engineer, I get in my java and aj generated classes the catalog value that matches the name of the database I reverse engineered.
      I think that's not ideal, because usually what I do is to parametrize database.properties so it's entries get replaced depending on maven build profile.

      So, for example, if I have db called my_db after DBRE I will have catalog="my_db" in java and aj files.

      Then if I execute CI build which uses my_test_db, hibernate will not pick it up and will try to create schema in my_db instead of my_test_db.

      Would it be possible to avoid writing catalog value in generated model?
      Thanks.

        Activity

        Hide
        Alan Stewart added a comment -

        Change made in Git ID 5cdbd9512777611cd3253638e223ba884c42c1f2. Note that this is for new entities - those entities created before this change will require manual removal of the catalog name.

        Show
        Alan Stewart added a comment - Change made in Git ID 5cdbd9512777611cd3253638e223ba884c42c1f2. Note that this is for new entities - those entities created before this change will require manual removal of the catalog name.
        Hide
        Mohamed Riyazudeen added a comment -

        Hi,

        I am using Spring Roo 1.2.1 version, DBRE creates entity with below annotation.

        @RooJpaEntity(identifierType = IsDimPK.class, versionField = "", table = "IS_DIM", schema = "IS_TEST")

        And dbre.xml creates with schema name as alias

        <table alias="IS_TEST" name="IS_DIM">

        How i can avoid this hard coded schema name ?

        Thanks
        Riyaz

        Show
        Mohamed Riyazudeen added a comment - Hi, I am using Spring Roo 1.2.1 version, DBRE creates entity with below annotation. @RooJpaEntity(identifierType = IsDimPK.class, versionField = "", table = "IS_DIM", schema = "IS_TEST") And dbre.xml creates with schema name as alias <table alias="IS_TEST" name="IS_DIM"> How i can avoid this hard coded schema name ? Thanks Riyaz

          People

          • Assignee:
            Alan Stewart
            Reporter:
            Milan Agatonovic
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: