Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: newbie hibernate question for an existing system schema change
 
Similar Threads
CodeFutures FireStorm/DAO RC1
cascading classes and tables (how to update ?)
howto modify database structure ?
JUnit - Testing someone elses code
java.sql.Date and Oracle.