-->
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.  [ 1 post ] 
Author Message
 Post subject: Does Hibernate support Data Truncation and Data Modification
PostPosted: Tue Oct 17, 2006 12:58 am 
Newbie

Joined: Thu Oct 12, 2006 6:29 am
Posts: 4
Hi All,

What does Data truncation mean ?

I will explain my requirement with example :
I have a table EMPLOYEE, it has columns NAME VARCHAR(20),AGE NUMBER(4) and SALARY VARCHAR(10).

For the first time the tables are created with the intial length and the following values are inserted into the table :
NAME : JAINY
AGE : 25
SALARY : 5000000000

Now my requirement is to set the length of SALARY column from 10 to 5 and if data present in the the column is greater than the new length do a substring and then alter the table with new length.

i.e when we dont use hibernate , I run a query UPDATE EMPLOYEE SET SALARY = SUBSTR(SALARY, 0, 5) and then i run a query ALTER TABLE SALARY MODIFY(SALARY VARCHAR(5)).

Now my question is : Does hibernate provide any option to achieve the above requirement or I have to execute the above set of queries only and if I have to execute Update and Alter table queries , how to execute alter table modify option.

What does Data Modification mean ?

Consider the EMPLOYEE table mentioned above. My requirement for Datatype modifiation is to change the datatype of SALARY cloumn from VARCHAR to NUMBER. Can this be achived by just changing the Data Type in the Employee POJO class. If not then how to achieve this ?

Hibernate version: 3.1.3

Name and version of the database you are using:Oracle9i


Thanks in advance.
All the help is much appreciated.

Regards ,
Jainy.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.