Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-2742

Don't update database upon switching JPA provider if any entities are DBRE-managed

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.2.0.M1
    • Fix Version/s: 1.2.0.RC1
    • Component/s: PERSISTENCE
    • Labels:
      None

      Description

      The internal "bike shop" test project uses MySQL with Hibernate. If after creating the project you change the JPA provider, e.g. as follows:

      persistence setup --database MYSQL --provider ECLIPSELINK

      ... then in persistence.xml, the provider is configured to update the database schema, e.g.:

      <!-- value="drop-and-create-tables" to build a new database on each run; value="create-tables" creates new tables if needed; value="none" makes no changes to the database -->
      <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>

      This is not desirable if project has any DBRE-managed entities, as by definition the corresponding tables should never be updated. It would be better for the above property to be set so as not to update the schema (i.e. "none" in the case of EclipseLink). While this would mean not creating or updating the required tables for non-DBRE entities, this is the lesser of two evils.

        Attachments

          Activity

            People

            Assignee:
            stewarta Alan Stewart
            Reporter:
            aswan Andrew Swan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: