-->
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: Hibernate Criteria- Projections for date_trunc?
PostPosted: Thu Jun 04, 2009 12:55 pm 
Newbie

Joined: Thu Jun 04, 2009 12:51 pm
Posts: 1
Hi,

Iam trying to use Hibernate Criteria Query .I have the following PostgreSQL statement

Select x, date_trunc('month',y) from table


I dont know how to use the projections for date_trunc('month',y) ?

appreciate your help.

Thanks,

Sowmya.


Top
 Profile  
 
 Post subject: Re: Hibernate Criteria- Projections for date_trunc?
PostPosted: Sun Jun 07, 2009 7:05 am 
Beginner
Beginner

Joined: Mon Jun 01, 2009 5:39 am
Posts: 34
HQL has a month() function.

Maybe a:

Code:
select x, month(y) from table


will do the trick? Not tested.


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.