-->
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: EJBQL to sql mapping
PostPosted: Mon Jul 28, 2008 7:42 am 
Newbie

Joined: Mon Jul 28, 2008 7:28 am
Posts: 1
hi all!

i have a problem with the following setup. i have two entities mapped to exactly two tables in oracle. i would like to generate list with dynamic filtering, so i have an ejbql fragment (select prop1, prop2.prop1, prop3 from entity1) creating the where condition at runtime. i have problem with the sql hibernate generates from this code. the problem is:

entity1 has a foreign key to entity2 which can be null (is optional). but hibernate creates a cross join and a where stating entity1.fk = entity2.id.

entity1.fk has annotations:

@ManyToOne(fetch=FetchType.LAZY, optional=true, targetEntity=Entity2.class)
@JoinColumn(name="fk_id")


how can i make hibernate do a left join instead of this cross join?


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.