-->
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: Needing Date functions for calculating difference
PostPosted: Mon Aug 11, 2008 4:46 am 
Beginner
Beginner

Joined: Thu Oct 04, 2007 12:22 pm
Posts: 48
I need to port a MySql-Query to hibernate. My goal is not to use native queries but in one case I am missing a function to calculate a difference to two dates.

The query subtracts two dates via MySql DATEDIFF (returns difference in days) and compares the result to an integer. I found no Hibernate equivalent to this except using native Sql. Is there an alternative?


Hibernate version:
3.2


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 11, 2008 5:30 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Hmmm... I am using Hibernate 3.2.5 and the DATEDIFF function is available in the MySQL dialect.


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.