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.  [ 4 posts ] 
Author Message
 Post subject: NHibernate Date Type?
PostPosted: Mon Nov 07, 2005 3:55 pm 
Newbie

Joined: Fri Nov 04, 2005 2:45 pm
Posts: 18
Location: Gainesville, FL
Does NHibernate support a native date type? There isn't one mentioned in the docs (though there is in the Hibernate docs), but when I set type="date" in one of my mapping files, it seems to be supported. Is there some magic going on here that I'm not seeing, with NHibernate automatically converting between the SQL and .NET date types?

If NHibernate does support dates, what other types does it support? Any .NET object? I notice that the docs list the options for value types and for large object types, but not for "normal" (I guess? the distinction between these and "large" types isn't made clear) types.

Sorry for what is probably a newbie question, still trying to get a handle on everything here.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 10:28 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
NHibernate supports System.DateTime. If you have a property of this type, you don't even need to set type="...".
There is also NullableDateTime (in the Nullables library)...

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 11:13 am 
Newbie

Joined: Fri Nov 04, 2005 2:45 pm
Posts: 18
Location: Gainesville, FL
KPixel wrote:
NHibernate supports System.DateTime. If you have a property of this type, you don't even need to set type="...".
There is also NullableDateTime (in the Nullables library)...


Is this the case for most objects, to use Reflection (I guess) to work out the type of the property?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 10:49 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
IMO, it is safer and I see no disadvantages of doing that.
But it is still required in few cases like Nullables, *LOB, etc.

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.