jpa-spec
  1. jpa-spec
  2. JPA_SPEC-31

Standard property for DDL generation

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      In JPA 2 it's possible for a developer to influence how DDL gets generated, e.g. via various attributes on the @Column annotation. However, how to actually tell the persistence provider that it should in fact generate DDL is not defined in the spec.

      This leads to verbose entries in persistence.xml such as the following:

       <properties>
          <!-- Hibernate -->
          <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                  
          <!-- EclipseLink  -->
          <property name="eclipselink.ddl-generation" value="create-tables" />
          <property name="eclipselink.ddl-generation.output-mode" value="database" />
      
          <!-- OpenJPA -->
          <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
      </properties>
      

      Not only does it make the descriptor verbose, it also requires the developer having to hunt for this information for all known persistence providers, and it will most likely not cover any future persistence providers.

      Since this is clearly not optimal, I would like to request introducing a standard property that tells the persistence provider to do DDL generation.

        Activity

        Hide
        ldemichiel added a comment -

        This item is currently under consideration. Please see the thread on schema generation.

        Show
        ldemichiel added a comment - This item is currently under consideration. Please see the thread on schema generation.
        Hide
        ldemichiel added a comment -

        Metadata for schema generation has been added

        Show
        ldemichiel added a comment - Metadata for schema generation has been added

          People

          • Assignee:
            Unassigned
            Reporter:
            arjan tijms
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: