Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 18:10 Go to next message
Eclipse UserFriend
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 20:15 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
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] Mon, 24 March 2008 00:06 Go to previous message
Matthieu Helleboid is currently offline Matthieu HelleboidFriend
Messages: 18
Registered: July 2009
Junior Member
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 20:15 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
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] Mon, 24 March 2008 00:06 Go to previous message
Matthieu Helleboid is currently offline Matthieu HelleboidFriend
Messages: 18
Registered: July 2009
Junior Member
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
>
>
Previous Topic:[Teneo] Association table not created for one-to-many EMF reference
Next Topic:ws:file in JET2
Goto Forum:
  


Current Time: Sat Jun 19 10:46:26 GMT 2021

Powered by FUDForum. Page generated in 0.02330 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top