-->
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: Error when trying to use Convert() (Hibernate+Spring)
PostPosted: Mon Mar 02, 2009 6:50 pm 
Newbie

Joined: Mon Mar 02, 2009 6:30 pm
Posts: 2
Greetings,

Warning, I don't claim to be a SQL expert.

I have a table that uses Date as a timestamp, keeping nanosecond precision. I have a need to do a manual select query to count the number of rows by day and group them.

I am trying to execute the following query:
Code:
select count(*), convert(Date,hit.hitDatetime) from Hit hit group by convert(Date,hit.hitDatetime) order by convert(Date,hit.hitDatetime) 


I am getting the following error:
Code:
org.springframework.dao.InvalidDataAccessApiUsageException: No data type for node: org.hibernate.hql.ast.tree.MethodNode   
\-[METHOD_CALL] MethodNode: '(' 
    +-[METHOD_NAME] IdentNode: 'convert' {originalText=convert}   
    \-[EXPR_LIST] SqlNode: 'exprList' 
       +-[IDENT] IdentNode: 'Date' {originalText=Date}   
       \-[DOT] DotNode: 'hit0_.hit_datetime' {propertyName=hitDatetime,dereferenceType=4,propertyPath=hitDatetime,path=hit.hitDatetime,tableAlias=hit0_,className=com.xxx.redirect.model.Hit,classAlias=hit}   
          +-[ALIAS_REF] IdentNode: 'hit0_.hit_id' {alias=hit, className=com.xxx.redirect.model.Hit, tableAlias=hit0_}   
          \-[IDENT] IdentNode: 'hitDatetime' {originalText=hitDatetime}


Any assistance would be greatly appreciated. Thank you in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 05, 2009 11:55 am 
Newbie

Joined: Mon Mar 02, 2009 6:30 pm
Posts: 2
I'm going to give this one bump, since I'm still at a loss here.

Thanks


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.