-->
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: Terminology Question...
PostPosted: Thu Oct 25, 2007 1:27 pm 
Newbie

Joined: Thu Oct 25, 2007 1:18 pm
Posts: 6
We (the company I work for) wanted to implement Hibernate as our persistence layer, but I am having a little trouble find answers because of terminology...

I have a lot of questions about updating databases. We write software and when the software starts we check the database version (not the database software version) to make sure it is up to date. If not we run through a series of code to update database (adding tables, altering columns, inserting data, dropping tables).

Is there a term I should be searching for to bring up topics like this? Will Hibernate handle this type of database manipulation? Anyone know of any examples of this situation?

_________________
Give a man a fish, feed him for a day. Teach a man to fish, lose your monopoly on fisheries.


Top
 Profile  
 
 Post subject: hbm2dll.auto = validate
PostPosted: Thu Oct 25, 2007 3:42 pm 
Newbie

Joined: Thu Oct 25, 2007 3:37 pm
Posts: 17
Hey. You might check out the 'validate' setting for the configuration property "hbm2dll.auto" -- its supposed to check that your hibernate meta-data model matches the existins schema in the database.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 25, 2007 4:08 pm 
Newbie

Joined: Thu Oct 25, 2007 1:18 pm
Posts: 6
I took a look at that... and it seems that it will update the database by adding the columns / tables that need to be added. BUT... am I right in seeing that it will not drop tables / columns that are no longer needed?

Example:
Table: Employee
Columns: ID, Name

This worked fine for a while, but now we need to store First name and Last name separately... so we need it to look like...
Table Employee
Columns: ID, FirstName, LastName


Can hibernate handle this? should I be looking somewhere else?

_________________
Give a man a fish, feed him for a day. Teach a man to fish, lose your monopoly on fisheries.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 26, 2007 10:51 am 
Newbie

Joined: Thu Oct 25, 2007 1:18 pm
Posts: 6
I took a look at the DDL hibernate tool... and it seems rather nice...
but I need to accomplish the database 'refactor' in my application.

Does no other company deal with this issue?

_________________
Give a man a fish, feed him for a day. Teach a man to fish, lose your monopoly on fisheries.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 26, 2007 10:58 am 
Newbie

Joined: Thu Oct 25, 2007 3:37 pm
Posts: 17
I don't really know about this stuff cause I haven't used it, but the book says that you can also do that schema validation with code.

There's a class called SchemaValidator( Configuration conf ) that can provide some schema checking functionality.


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.