-->
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.  [ 2 posts ] 
Author Message
 Post subject: Using Oracle backend with NHibernate
PostPosted: Tue Mar 04, 2008 11:28 am 
Newbie

Joined: Tue Mar 04, 2008 9:57 am
Posts: 1
Location: Atlanta
NHibernate version:1.2


I am using NHibernate 1.2, C#, ASP.NET 2.0, Oracle 9.
How do I pass sysdate/DateTime in NHibernate Criteria

My Criteria is as follows:
assignmentCriteria.Add(new LeExpression("START_DATE", startDate));

I am using C# DataTime
START_DATE Column is defined as oracle default Date (dd MMM yyyy in my Oracle database
I got some suggesion of using Oracle To_Date Function in the NHibernate Criteria but that did not work for me. It is as follows:
assignmentCriteria.Add(new LeExpression("START_DATE", "to_date('" + startDate + "','dd MMM yyyy')"));


Thanks fot any help


Please disregard this. I have solved my problem. Thank you.

_________________
Jama
jamam@bellsouth.net


Last edited by mjama on Wed Mar 05, 2008 3:05 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Using Oracle backend with NHibernate
PostPosted: Tue Mar 04, 2008 1:19 pm 
Senior
Senior

Joined: Thu Jun 21, 2007 8:03 am
Posts: 127
Location: UK
Hi,

I'm guessing you want something like:
Code:
assignmentCriteria.Add(Expression.Le("StartDate", startDate));


Can you post your mapping file to shed more light on the problem you're having? And also the exception you're getting?

Thanks,
Richard


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