-->
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.  [ 2 posts ] 
Author Message
 Post subject: My outer-join doesn't work...
PostPosted: Fri Apr 11, 2008 1:36 am 
Newbie

Joined: Sun Mar 30, 2008 10:15 pm
Posts: 18
Hello I have an entity that has a 1-to-many relationship with another entity.

I have define the map as
<set name="ws" outer-join="true">
<key property-ref="a" column="I_ID"/>
<one-to-many class="W" />
</set>

it works fine except that it always runs as a single join query. I'd like to run it as a single left outer join.

Am I missing something?

The other thing is that I'm running it from a criteria:
c = session.createCriteria(MyEntity.class);

Does that have anything to do it?

Your help would be greatly appreciated!

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 11, 2008 10:41 am 
Newbie

Joined: Sun Mar 30, 2008 10:15 pm
Posts: 18
The reason it was ignoring my left outer join is because I was creating an alias in my criteria.

In order to enable the outer join I did the following:
criteria.createAlias(alias, alias, CriteriaSpecification.LEFT_JOIN);

Now it is good.

Thanks


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

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.