Hi,
Here is my HQL-Query and the translated SQL as well:
Code:
2004-02-19 16:41:36,964 DEBUG [net.sf.hibernate.hql.QueryTranslator] HQL: SELECT ctv.id, ctv.name FROM ChannelTreeVersion AS ctv WHERE ctv.activationDate <= [b]SYSDATE[/b] and ctv.activationDate in (SELECT max(ctv1.activationDate) FROM bbt.cn.core.bo.ChannelTreeVersion as ctv1 WHERE ctv1.activationDate <= [b]SYSDATE[/b]) GROUP BY ctv.id, ctv.name
2004-02-19 16:41:36,964 DEBUG [net.sf.hibernate.hql.QueryTranslator] SQL: select channeltre0_.CTV_ID as x0_0_, channeltre0_.CTV_NAME as x1_0_ from CHANNELTREEVERSION channeltre0_ where (channeltre0_.CTV_ACTIVATIONDATE<=[b]SYSDATE[/b] )and(channeltre0_.CTV_ACTIVATIONDATE in(select max(channeltre1_.CTV_ACTIVATIONDATE) from CHANNELTREEVERSION channeltre1_ where (channeltre1_.CTV_ACTIVATIONDATE<=[b]SYSDATE[/b] ))) group by channeltre0_.CTV_ID , channeltre0_.CTV_NAME
I am using the PostgreSQL-DB and therefore it should replace SYSDATE with either CURRENT_DATE or CURRENT_TIMESTAMP!
The other things worked just fine!
best regards,
gimi