-->
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: if set Date type field,the Primary Key Field Value changed ?
PostPosted: Tue Oct 12, 2004 6:34 am 
Newbie

Joined: Tue Oct 12, 2004 6:19 am
Posts: 1
I use Oracle DB ,if I set the Date type filed, the value of primary key( number(8)) changed, if not set the value of the Date type field, it worsk
fine ,can any body help me ?


Test test=new Test(2);

test.setIntegerField(new Integer(2)) ;
test.setNumberField(new Float(2.2)) ;

// if add the following code ,the record can insert to DB and the value of date field is correct ,but the Primary key changed

test.setDateField( new java.util.Date()) ; // if not add the code, it works fine and the value of primary key is correct


in xml file the map type is timestamp

the result in db is :
SQL> select id,integer_field ,number_field,date_field from t_test;

ID INTEGER_FIELD NUMBER_FIELD DATE_FIELD
---------- ------------- ------------ ----------
2 2 2.2
4.6000E-53 2 2.2 12-10月-04


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.