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.  [ 6 posts ] 
Author Message
 Post subject: How to get date with using Nhibernate from sql server!
PostPosted: Sun Dec 31, 2006 2:46 am 
Newbie

Joined: Sun Dec 31, 2006 2:40 am
Posts: 4
as the title!
Thanks![/b]

_________________
help!!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 01, 2007 9:03 pm 
Newbie

Joined: Mon Jan 01, 2007 6:18 pm
Posts: 11
Location: New Zealand
http://www.hibernate.org/178.html This article has a bit of java code on how to do what u want.

from memory this is how it is done in .net (sort of in pseudo). The class is shown below:

Code:
class CLASSNAMEHERE
{

   public DateTime theDate
   {
       get { return System.datetime.Now(); }
   }

}


The mapping is nothing special, you do not need to declare a mapping type.

If this doesn't help there is a really good NHibernate example available at this link: http://www.benday.com/temp/nhibsampleVS2005.zip


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 1:06 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
The problem with this approach is that the datetime value is not from the SQL server but from the server where NHibernate is running.

I'm looking for a solution for this too.

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 8:29 pm 
Newbie

Joined: Sun Dec 31, 2006 2:40 am
Posts: 4
Maybe I did not describe it clearly.
"select getdate()" how to do it with NHibernate!

_________________
help!!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 8:50 pm 
Newbie

Joined: Sun Dec 31, 2006 2:40 am
Posts: 4
Maybe I did not describe it clearly.
"select getdate()" how to do it with NHibernate!

_________________
help!!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 8:52 pm 
Newbie

Joined: Sun Dec 31, 2006 2:40 am
Posts: 4
Maybe I did not describe it clearly.
"select getdate()" how to do it with NHibernate!

_________________
help!!!


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