Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1442 Scaffolding issues in Forge 2.Beta
  3. FORGE-1443

database.action property in persistence.xml should be drop-and-create

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • 2.0.0.CR2
    • 2.0.0.Beta4
    • Scaffold
    • None

      When you setup JPA in Forge 1.x you get :

      <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
      

      In Forge 2.Beta instead of drop-and-create you get only create :

      <property name="javax.persistence.schema-generation.database.action" value="create"/>
      

      Instead you should have

      <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
      

      And by the way, why not generating the DDL script as well ? You could have :

      <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
      <property name="javax.persistence.schema-generation.scripts.action" value="drop-and-create"/>
      <property name="javax.persistence.schema-generation.scripts.create-target" value="<projectName>Create.ddl"/>
      <property name="javax.persistence.schema-generation.scripts.drop-target" value="<projectName>Drop.ddl"/>
      

              ivan_stefanov Ivan St. Ivanov (Inactive)
              agoncal Antonio Goncalves (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: