-
1. Re: EJB QL requires useless item in select list
epbernard Dec 19, 2006 8:39 AM (in response to owaind)No, Hibernate is not dumb.
Like in SQL, HQL requires the grouby proeprties to be part of the select. You have to include r.channel -
2. Re: EJB QL requires useless item in select list
owaind Dec 19, 2006 9:45 AM (in response to owaind)even without the group by the query fails in exactly the same way!
whats going on hibernate? -
3. Re: EJB QL requires useless item in select list
owaind Dec 19, 2006 9:49 AM (in response to owaind)and also sql doesnt require that the group by field is included in the select
-
4. Re: EJB QL requires useless item in select list
owaind Dec 19, 2006 9:51 AM (in response to owaind)org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list [FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=c,role=null,tableName=Channel,tableAlias=channel1_,origin=Request request0_,colums={request0_.channel_FK ,className=com.telepathyproof.adventure.ejb.entity.channel.Channel}}] [select c.id, sum(se.currentListeners) from com.telepathyproof.adventure.ejb.entity.stats.Request r inner join fetch r.channel c left join fetch r.stats s left join fetch s.statsEntries se where r.createdDate > :startDate and r.createdDate < :endDate]
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:195)