|automatic schema update [message #675977]
||Thu, 02 June 2011 05:03
| kRu Missing name
Registered: June 2011
I'm currently using EclipseLink 2.2 with HSQLDB 2.2 for an embedded file db. I've defined the structure of the db by using JPA annotations. The problem I have now is, that updating the structure (class members/annotations) will be not reflected in the db structure.|
Via eclipselink.ddl-generation setting I can create the db completly new, but I want to keep the old data and just "update" the structure.
I found this feature in ObjectDB as "Automatic Schema Evolution" and it's described as following:
- For every field in the new schema for which there is a matching field in the old schema, the new field in the new entity object is initialized using the value of the matching old field in the original entity object.
- Fields in the new schema that do not have matching fields in the old schema are initialized with default values (0, false or null).
- Fields in the old schema that do not have matching fields in the new schema are simply ignored (and their content is lost).
Also Hibernate has an option called hibernate.hbm2ddl.auto for updating the schema or validate it.
Is there a possibility to get my desired behavior, i.e. keeping the old data and update the structure?
Thanks in advance,
Powered by FUDForum
. Page generated in 0.02164 seconds