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
|