-->
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.  [ 1 post ] 
Author Message
 Post subject: Join Fetch with non-default constructor not working
PostPosted: Mon Mar 15, 2010 1:10 am 
Newbie

Joined: Mon Mar 15, 2010 1:01 am
Posts: 4
I am migrating from hibernate 3.0.5 to 3.3.2.GA.
I have an HQL Query with a non Default constructor and a join fetch. When i run it with non Default constructor it gives me 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=pr,role=null,tableName=DOCUMENT_PRECEDENCE,tableAlias=precedence1_,origin=DOCUMENT_OUT documentou0_,colums={documentou0_.DOC_PRECEDENCE_ID ,className=Precedence}}] [ select distinct new DocumentOut(doc.id, doc.documentId, pr, doc.subject, doc.dispatchStatus) from DocumentOut doc join fetch doc.precedence pr order by pr.precedenceOrder ]
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:217)
at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:831)
at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:619)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:672)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:288)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:231)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1651)
at Test.createDraftHQLQuery(Test.java:90)
at Test.getDraftHQL(Test.java:83)
at Test.executeQuery(Test.java:36)
at Test.main(Test.java:22)


where as when i comment out the non default constructor it runs fine.
This query was working fine in 3.0.5
I need an urgent help as my client is in haste. Kindly help me out with issue, i am stuck up.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.