-->
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: How to query based on attribute of embedded PK
PostPosted: Mon Apr 04, 2011 4:14 am 
Newbie

Joined: Mon Apr 04, 2011 4:04 am
Posts: 2
I have 2 entities, one an embedded PK (lets call it b) of the other (lets call it a). I need to query based on a Date attribute within the PK - start_date_time. I have tried a query like
Code:
SELECT MAX(start_date_time) FROM a


resulting in:

Exception: javax.ejb.EJBTransactionRolledbackException: No data type for node: org.hibernate.hql.ast.tree.AggregateNode

16:12:11,971 INFO [STDOUT] \-[AGGREGATE] AggregateNode: 'MAX'

16:12:11,971 INFO [STDOUT] \-[IDENT] IdentNode: 'start_date_time' {originalText=start_date_time}


I guess Hibernate is not recognising that start_date_time is type TemporalType.Date as it is defined within the PK not the top level class. How should I go about this query?


Top
 Profile  
 
 Post subject: Re: How to query based on attribute of embedded PK
PostPosted: Mon Apr 04, 2011 8:42 pm 
Newbie

Joined: Mon Apr 04, 2011 4:04 am
Posts: 2
bump


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.