I have been searching web, here, and other places. Since Hibernate is such a neat tool my gut tells me there has to be a way of changing schemas without loosing data. I am new to Java and learning techniques that I took for granted in the VB6 world. I have a class that starts with opening a connection for different ODBC models and managing them. Then once a base line schema was done, the class when created would scan the fields and alter the schema as needed. Why reinvent the wheel.
Now I found Hibernate and it seems like a dream come true (with my limited Java experience). The one thing that bothers me is there is no self-healing for the schema without loosing data. Any change Hibernates sees from the mapping file to the table drops the whole table and then creates a whole new schema. I was hoping there was a configuration that would modify this behavior, but I have not found it yet.
My first questions is; “is there a option that causes Hibernate to alter tables instead of the “drop/create new” approach?
I did not see any events or interceptors that explicitly address this. Did I miss one? Is there a work around? Is there some place to get some code examples?
Does these questions make sense?
Thanks in advance for any help.
BTW, Just so the parents of small children don't feel left out, why is the sky blue? :-)
_________________ Thanks,
PE
|