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: What is the best practice to handle database change?
PostPosted: Tue Apr 04, 2006 12:39 pm 
Newbie

Joined: Tue Oct 04, 2005 3:30 am
Posts: 3
Hi,

We are going to re-develop our core system.
CompanyA is responsible for this project.
They will re-design out database (Oracle).
In the meantime, we have to develop some small systems.

So, we are developing some codes on a changing database!
For handling such complex issues, they suggested us to use PL/SQL to write business logic, so if the database changes, we can immedateldy know which code will be affected.

But, I really don't want to wirte business logic in PL/SQL(stored procedure)....
Write unit test code, will still miss something ....
ex: the developer may forget to write the testing code ....

Is there any best practice to handle such situation?


Thanks.


Top
 Profile  
 
 Post subject: Re: What is the best practice to handle database change?
PostPosted: Tue Apr 04, 2006 4:53 pm 
Beginner
Beginner

Joined: Fri Mar 17, 2006 7:30 pm
Posts: 32
leonchen wrote:
Hi,

We are going to re-develop our core system.
CompanyA is responsible for this project.
They will re-design out database (Oracle).
In the meantime, we have to develop some small systems.

So, we are developing some codes on a changing database!
For handling such complex issues, they suggested us to use PL/SQL to write business logic, so if the database changes, we can immedateldy know which code will be affected.

But, I really don't want to wirte business logic in PL/SQL(stored procedure)....
Write unit test code, will still miss something ....
ex: the developer may forget to write the testing code ....

Is there any best practice to handle such situation?


Thanks.


I'm not sure I understand the question. What types of changes are being considered?

If the tables or columns might change, but the data structure doesn't, then code the POJOs needed to hold the data and map them to the tables with the XML (don't use annotations here). Let Hibernate handle the mapping and such.

If the changes are going to be more complex (ie- tables being normalized, data types changing from ints to Strings, etc), then please give a bit more details on what it is you are considering and what you seek.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 05, 2006 1:06 am 
Newbie

Joined: Tue Oct 04, 2005 3:30 am
Posts: 3
Thanks.

The most important thing is because the database is not controled by us,
there will be many kindes of changes, including: add table, delete table,
add column, delete column, reaname table, rename column .... ... basically, they can change every thing of database ....

Take the column's change (rename or delete) as an example:
Yes, XML mapping files may solve some problmes ...
But there will be many hql queries, if a column is renamed or deleted, we will have to search every hql query in the mapping file or src code. (or we don't have ?)
And they say, if we use PL/SQL, PL/SQL IDE will help us to check the changes in the complie time.

Thanks!


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.