[jboss-user] [JBoss Seam] - Framework: Counting query entities

chris@dvdb.de do-not-reply at jboss.com
Fri Apr 13 14:21:58 EDT 2007


Hi!

I'm trying to use the statement "from MediabaseItemCollectible mic left inner join fetch mic.item as item" as a framework:entity-query. 
It works fine as as long as the seam framework does not try to execute the count query generated in o.j.s.framework.Query class (getCountEjbql) (e.g. for pagination) with the following hiberante error:

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=item,role=null,tableName=dvdb2_item,tableAlias=item1_,origin=dvdb2_mediabase_item mediabasei0_,colums={mediabasei0_.item_id ,className=de.dvdb.database.domain.Item}}] [select count(mic) from de.dvdb.mediabase.domain.MediabaseItemCollectible mic left outer join fetch mic.item as item where mic.mediabase.id = 43303
  | 

It works fine if I remove the "fetch" keyword but that's definitely not the way I want to go.

I've read that since 3.1 hibernate is more picky on the semantic on hql statements and the generated count statement does not make sense. 

So, what are my options? I hope somebody here has a good idea :D

Chris


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037193#4037193

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037193



More information about the jboss-user mailing list