-->
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: MySql DATETIME
PostPosted: Thu Jun 30, 2005 11:57 am 
Hi there,

MySql has a DATETIME column type for storing dates such as "2005-01-01 09:30:00".

In my NHIbernate mapping files, I'm mapping .NET DateTime properties to MySql DATETIME columns like this...

Code:
<property name="TimeLastIndexed" column="time_last_indexed" type="DateTime"/>


However, it's buggered! For some reason, the log file shows that NHibernate is binding date values but NOT with time also. E.g

Code:
2005-06-30 15:03:52,528 [4524] DEBUG NHibernate.Type.NullableType [] <> - binding '10/01/2005' to parameter: 2


I'm using NHibernte release 8.4

I couldn't find this bug on Jira, so I'm guessing that I must be doing something stupid!? Any help much appreciated.

Tobin


Top
  
 
 Post subject:
PostPosted: Thu Jun 30, 2005 11:58 pm 
Newbie

Joined: Wed May 18, 2005 1:28 am
Posts: 5
Location: Depok, Indonesia
Have you checked the values inside column "time_last_indexed"? Is it true the values only contains the date, but not the time?

Hmmm ... is it possible the type is mismatch between the property in your .Net class and the column in your database?

_________________
-Adin


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 01, 2005 5:52 am 
Thanks for replying.

Yup, unfortunatley the database columns are not storing the time, despite that fact that they're DATETIME columns. I've also tried TIMESTAMP columns, with no luck either.

I had a look in the NHibernate source, I see this in the MySQLDialect, which looks ok...

Code:
RegisterColumnType( DbType.Date, "DATE" );
RegisterColumnType( DbType.DateTime, "DATETIME" );
...
RegisterColumnType( DbType.Time, "TIME" );


sooooo... it must be my code...

...and after spending 10 minutes digging around, I've found that my test case was set up wrong. Lol. What a plonker!

Thanks again

Tobin


Top
  
 
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.