-->
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: CURRENT_DATE, CURRDATE and NOW() is not working
PostPosted: Thu Feb 14, 2008 10:28 am 
Newbie

Joined: Wed Jan 02, 2008 6:11 am
Posts: 6
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2.5

Mapping documents:

Code between sessionFactory.openSession() and session.close():
sessionFactory.getCurrentSession().beginTransaction();
System.out.println(""+sessionFactory.getCurrentSession().createQuery("select NOW() from Quest q").uniqueResult());


Full stack trace of any exception that occurs: getting null value

Name and version of the database you are using: hsqldb 1.8.0.7 for Unit testing and MYSQL for Production

The generated SQL (show_sql=true): Hibernate: select now() as col_0_0_ from Quest quest0_

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 15, 2008 10:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
This is the tools forum you might get more answers in the user forum - having said that I did a quick look and the docs recommend CURRENT_TIMESTAMP() instead of NOW() . Not sure what this really means as I do not use that database. Also, check the dialect to make sure it is aware of the now() function and is returning the correct type.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 06, 2008 6:14 am 
Newbie

Joined: Wed Jan 02, 2008 6:11 am
Posts: 6
Thanks for your response


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