-->
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.  [ 1 post ] 
Author Message
 Post subject: MySql function with hibernate criteria
PostPosted: Thu Jun 24, 2010 8:41 am 
Newbie

Joined: Thu Jun 24, 2010 8:24 am
Posts: 5
Hi All,

I'm using MySQL, I have a table in which one column is of time type and I have a requirement to find out the sum of that column. The problem is column is of time type and if i am using sum method of projections then the result is not correct.

The following query returns the desired result:
SELECT SUM(TIME_TO_SEC(time_detail)) FROM demo.test t;

Please suggest if there is any way to to call MySQL functions using hibernate. I'm looking for a solution other than native SQL queries like session.createSQLQuery().

_________________
Thanks,
Sandeep Bhardwaj


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.