-->
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.  [ 3 posts ] 
Author Message
 Post subject: How do I update my Java model class after adding one column?
PostPosted: Fri Oct 23, 2009 10:10 am 
Newbie

Joined: Wed Oct 14, 2009 3:22 pm
Posts: 16
Hi,

I'm using Java 1.5, Resin 3.0.19 ,Hibernate 3.4.0.GA and Oracle 10g. I inherited a project that has mapped a Java class to an Oracle table. Now I need to add an extra column to the Oracle table, which I've done through a simple "ALTER TABLE" statement. What is the easiest way to update my Java model? I'm using a Mac OS 10.5.6 (Unix essentially) and Eclipse Galileo.

Thanks, - Dave


Top
 Profile  
 
 Post subject: Re: How do I update my Java model class after adding one column?
PostPosted: Fri Oct 23, 2009 8:29 pm 
Newbie

Joined: Fri Apr 03, 2009 4:12 pm
Posts: 9
Hello,

I'm kind of new with hibernate as well, but what I do is add the mapping in my hibernate configuration an let hibernate add the new column using the property
Code:
<property name="hibernate.hbm2ddl.auto">update</property>
.

Of course you could also just add the mapping after altering the table, I don't think it matters who created the column.

_________________
Santiago GarcĂ­a Pimentel R.G.


Top
 Profile  
 
 Post subject: Re: How do I update my Java model class after adding one column?
PostPosted: Fri Oct 23, 2009 10:03 pm 
Newbie

Joined: Fri Oct 23, 2009 9:57 pm
Posts: 1
Are you asking to add new property without bringing the application or session factory down. Then you probably can not this. Even if you try to create a new factory, there will a problem with the old session. Best way is to bring your app down add this new property to mapping and bring the system back


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.