-->
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: Issue in using LEFT JOIN in HQL -
PostPosted: Fri Jan 23, 2015 7:47 am 
Newbie

Joined: Fri Jan 23, 2015 7:24 am
Posts: 1
Folks,

I have been using two tables to perform a Left Outer Join in HQL, but i am facing an issue that actual Left join is not happening instead inner join is performed. Kindly let me know how to solve the issue and the details are given below:

1st Class:
PartLinkCompetitorPartHeader
Attribute used:
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "CPRIODNAM", nullable = false, insertable = false, updatable = false)

private ModelName pricingModelName;

2nd Class:
ModelName.java
@Id
@Column(name = "CMDNAM", unique = true, nullable = false, length = PPMBusinessConstants.NUM_10)
private String modelNameCode;

I need to perform Left Join for PartLinkCompetitorPartHeader with ModelName class.
as the reference of ModelName object is available in PartLinkCompetitorPartHeader class. (Refer above)

The hql used:

compQuery.append(" FROM PartLinkCompetitorPartHeader hdr left join ModelName model where hdr.id.pricingModelName=model.modelNameCode" );

When i execute the above code, it results in inner join. Kindly advise on how to change this snippet to cater left join.

Thanks and Regards,
Ramnath


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.