Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » Update database schema with Teneo/Hibernate
Update database schema with Teneo/Hibernate [message #115490] |
Sun, 23 March 2008 14:10  |
Eclipse User |
|
|
|
Originally posted by: schlamp.medihack.org
The question belongs a bit more to Hibernate than Teneo, but I think it
must be quite a common database problem especially for Rich Client
Applications.
When I have to change my EMF model, that is persisted with
Teneo/Hibernate, for a new version of my application, then what is the
best way to update the database schema?
As I understand, the automatic Hibernate updater is very limited (e.g.
can't delete columns or whole tables).
I found an interesting 4 year old discussion on the Hibernate message
board, but without any good solution.
How do developers solve this problem now? I there a good sql dialect
independent solution? Any suggestions?
Best regards,
Kai
|
|
|
Re: Update database schema with Teneo/Hibernate [message #115513 is a reply to message #115490] |
Sun, 23 March 2008 16:15   |
Eclipse User |
|
|
|
Hi Kai,
It is true that hibernate won't delete tables or columns. On the other hand it will add columns and
tables (but not indexes). Many times this is sufficient, tables and columns which are not used
anymore are ignored and this works fine (as long as the columns are nullable ofcourse).
For me the hibernate update mode has been sufficient. I do not know of any other/better way.
Although if you find one then I would be interested to hear of it to :-).
gr. Martin
Kai Schlamp wrote:
> The question belongs a bit more to Hibernate than Teneo, but I think it
> must be quite a common database problem especially for Rich Client
> Applications.
> When I have to change my EMF model, that is persisted with
> Teneo/Hibernate, for a new version of my application, then what is the
> best way to update the database schema?
> As I understand, the automatic Hibernate updater is very limited (e.g.
> can't delete columns or whole tables).
> I found an interesting 4 year old discussion on the Hibernate message
> board, but without any good solution.
> How do developers solve this problem now? I there a good sql dialect
> independent solution? Any suggestions?
>
> Best regards,
> Kai
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Update database schema with Teneo/Hibernate [message #115540 is a reply to message #115513] |
Sun, 23 March 2008 20:06  |
Eclipse User |
|
|
|
Hello,
Teneo allow to export/import a datastore in xmi format, which is very
helpful. After the export you can drop/recreate the database, or use
hibernate to drop/create the schema. Most of the time, it is very helpful
if you have for example column length changes.
But if you have for example in column name, or other more complicated
changes in the mapping, I recommend to export the datastore from with the
old version of your application, and to export the xmi with the new
version.
The only problem is when you have a lot of data, because your hibernate
resource will very memory and time consuming. But you can export/import
subset of the datastore, by modifying for example the computeTopEntities of
the datastore.
Matthieu Helleboid.
Martin Taal wrote:
> Hi Kai,
> It is true that hibernate won't delete tables or columns. On the other
> hand it will add columns and tables (but not indexes). Many times this is
> sufficient, tables and columns which are not used anymore are ignored and
> this works fine (as long as the columns are nullable ofcourse). For me the
> hibernate update mode has been sufficient. I do not know of any
> other/better way. Although if you find one then I would be interested to
> hear of it to :-).
>
> gr. Martin
>
> Kai Schlamp wrote:
>> The question belongs a bit more to Hibernate than Teneo, but I think it
>> must be quite a common database problem especially for Rich Client
>> Applications.
>> When I have to change my EMF model, that is persisted with
>> Teneo/Hibernate, for a new version of my application, then what is the
>> best way to update the database schema?
>> As I understand, the automatic Hibernate updater is very limited (e.g.
>> can't delete columns or whole tables).
>> I found an interesting 4 year old discussion on the Hibernate message
>> board, but without any good solution.
>> How do developers solve this problem now? I there a good sql dialect
>> independent solution? Any suggestions?
>>
>> Best regards,
>> Kai
>
>
|
|
|
Re: Update database schema with Teneo/Hibernate [message #615962 is a reply to message #115490] |
Sun, 23 March 2008 16:15  |
Eclipse User |
|
|
|
Hi Kai,
It is true that hibernate won't delete tables or columns. On the other hand it will add columns and
tables (but not indexes). Many times this is sufficient, tables and columns which are not used
anymore are ignored and this works fine (as long as the columns are nullable ofcourse).
For me the hibernate update mode has been sufficient. I do not know of any other/better way.
Although if you find one then I would be interested to hear of it to :-).
gr. Martin
Kai Schlamp wrote:
> The question belongs a bit more to Hibernate than Teneo, but I think it
> must be quite a common database problem especially for Rich Client
> Applications.
> When I have to change my EMF model, that is persisted with
> Teneo/Hibernate, for a new version of my application, then what is the
> best way to update the database schema?
> As I understand, the automatic Hibernate updater is very limited (e.g.
> can't delete columns or whole tables).
> I found an interesting 4 year old discussion on the Hibernate message
> board, but without any good solution.
> How do developers solve this problem now? I there a good sql dialect
> independent solution? Any suggestions?
>
> Best regards,
> Kai
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Update database schema with Teneo/Hibernate [message #615964 is a reply to message #115513] |
Sun, 23 March 2008 20:06  |
Eclipse User |
|
|
|
Hello,
Teneo allow to export/import a datastore in xmi format, which is very
helpful. After the export you can drop/recreate the database, or use
hibernate to drop/create the schema. Most of the time, it is very helpful
if you have for example column length changes.
But if you have for example in column name, or other more complicated
changes in the mapping, I recommend to export the datastore from with the
old version of your application, and to export the xmi with the new
version.
The only problem is when you have a lot of data, because your hibernate
resource will very memory and time consuming. But you can export/import
subset of the datastore, by modifying for example the computeTopEntities of
the datastore.
Matthieu Helleboid.
Martin Taal wrote:
> Hi Kai,
> It is true that hibernate won't delete tables or columns. On the other
> hand it will add columns and tables (but not indexes). Many times this is
> sufficient, tables and columns which are not used anymore are ignored and
> this works fine (as long as the columns are nullable ofcourse). For me the
> hibernate update mode has been sufficient. I do not know of any
> other/better way. Although if you find one then I would be interested to
> hear of it to :-).
>
> gr. Martin
>
> Kai Schlamp wrote:
>> The question belongs a bit more to Hibernate than Teneo, but I think it
>> must be quite a common database problem especially for Rich Client
>> Applications.
>> When I have to change my EMF model, that is persisted with
>> Teneo/Hibernate, for a new version of my application, then what is the
>> best way to update the database schema?
>> As I understand, the automatic Hibernate updater is very limited (e.g.
>> can't delete columns or whole tables).
>> I found an interesting 4 year old discussion on the Hibernate message
>> board, but without any good solution.
>> How do developers solve this problem now? I there a good sql dialect
>> independent solution? Any suggestions?
>>
>> Best regards,
>> Kai
>
>
|
|
|
Goto Forum:
Current Time: Fri May 09 23:07:42 EDT 2025
Powered by FUDForum. Page generated in 0.03749 seconds
|