-->
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: can't use left join fetch since I am using 'with' clause.
PostPosted: Thu Mar 11, 2010 2:08 am 
Newbie

Joined: Wed Jan 23, 2008 7:45 am
Posts: 14
Location: Pune,India
Hello

I'm running the following query:

Code:
        qry = session.createQuery("from DealSynopsisHistory dh" +
              " left join dh.personCreateBy cb" +
                      " with cb.startTime <= :asOfDate" +
                      " and cb.endTime > :asOfDate" +
              " where dh.dealKey = 4563");


As documented here https://www.hibernate.org/117.html#A13, HQL is ignoring fetch="join" in the mapping files and doing a select fetch. When doing select fetches, the join conditions are ignored.

I am unable to understand why the join conditions are ignored while doing a select fetch. Also, since I am using the 'with' clause, I can't even use 'left join fetch'.

Is this a limitation or bug or is there some problem in the way I am understanding this?

Here is the relevant mapping between DealSynopsisHistory and PersonHistory tables.

Code:
DealSynopsisHistory.hbm.xml

<many-to-one name="createBy"  column="CREATE_BY" property-ref="kerberosId" entity-name="PersonHistory" fetch="join" lazy="false"/>


_________________
Harshal Vaidya


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.