session.createQuery("select ccrd.createdDate , s1 "
+ "from CrComponentRelDependency ccrd "
+ "left outer join ccrd.crComponentDependencyDtls s1 "
+ "where ccrd.crComponent.componentSeq= :COMPONENT_SEQ "
+ "and (ccrd.referencedComponentVer IS NULL) "
.setParameter("COMPONENT_SEQ", componentId);
This query is giving valid values for ccrd.createdDate , but it is returning NULL for s1 entity.
I have defined a one-to-one relation between CrComponentRelDependency & crComponentDependencyDtls.
HQL does all the joining for you, so don’t explicitly join tables. Try this:
Note also the removal of unnecessary qualification and brackets from your HQL.