Search code examples
javadatabaseoracle11gentity-bean

Entity Bean State after Database Migration


Does Migrating from one database to another database requires comprehensive change in the Entity Beans? I have oracle 11g express edition and I want to move to MS Sql?


Solution

  • No.Your entity class can remain the same. However, you may have to change the primary key generation strategy. You may also have to change values of some attributes of the @Column annotation.

    Your tables may slightly change due to the fact that different databases have their own ways of storing data. You can regenerate the tables by editing your persistence.xml

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