-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Is it possible for hibernate to alter the schemas on the fly
PostPosted: Thu Sep 22, 2005 7:31 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 7:22 am
Posts: 21
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.1

Code between sessionFactory.openSession() and session.close(): using hivetranse

Name and version of the database you are using:MySQL

I am thinking that it should be possible for hibernate to update my schemas if I alter the persistant classes (adding or removing properties). I have been messing with hibernate.hbm2ddl.auto, setting it to create etc. but that will result in dropping all tables and re-create them, thus loosing all data.

It should, as far as I can see, possible to just alter the tables as there are a ALTER in SQL and I have provided a SQLDialect.

Is this possible, and if so could someone please lead me in the right direction?

_________________
/ted


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 7:45 am 
Beginner
Beginner

Joined: Thu Apr 28, 2005 6:16 am
Posts: 20
Yes, I believe so. The documentation lists three modes: update | create | create-drop. Use update. The documentation is not very detailed: http://www.hibernate.org/hib_docs/v3/re ... ml_single/

Post if it works for you.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 8:10 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 7:22 am
Posts: 21
merlyn wrote:
Yes, I believe so. The documentation lists three modes: update | create | create-drop. Use update. The documentation is not very detailed: http://www.hibernate.org/hib_docs/v3/re ... ml_single/

Post if it works for you.


Ah, sorry!
I did try that but for some reason came I to the conclusion that it didn't work.
But it does!

thanks merlyn!

_________________
/ted


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 23, 2005 3:56 am 
Beginner
Beginner

Joined: Thu Apr 28, 2005 6:16 am
Posts: 20
Sweet. Any chance you could rate the post?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 23, 2005 4:01 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 7:22 am
Posts: 21
merlyn wrote:
Sweet. Any chance you could rate the post?


I did? Didn`t I?

_________________
/ted


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.