This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes newbie hibernate question for an existing system schema change Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "newbie hibernate question for an existing system schema change" Watch "newbie hibernate question for an existing system schema change" New topic
Author

newbie hibernate question for an existing system schema change

Laura Ferguson
Greenhorn

Joined: Mar 15, 2009
Posts: 1
HELP: We've added 4 new columns to an Oracle database. I've updated all of the references to the table I can find in the existing Java code, annotations and xml files. However, the hibernate generated sql code ignores these columns when a new record is added and only updates the pre-existing columns. What do I need to do to get hibernate to recognize the new columns? Is there a tool/task I need to run?

I'm using Intellij Idea, maven, hibernate, spring, Java 1.6 and an oracle db. I am new to web development as well as hibernate, so please spell it out for me. (Ack! I've been doing desktop application development since some time in the last century.)

Laura
Rahul Babbar
Ranch Hand

Joined: Jun 28, 2008
Posts: 210
I think the only things that are required for Hibernate to recognize the added columns are:
1. Update the .hbm.xml and the POJO files for the Table.
2. Build the application and restart the server.

That should do...


Rahul Babbar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: newbie hibernate question for an existing system schema change
 
Similar Threads
java.sql.Date and Oracle.
cascading classes and tables (how to update ?)
howto modify database structure ?
CodeFutures FireStorm/DAO RC1
JUnit - Testing someone elses code