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?