1
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);
此查詢給有效值ccrd.createdDate,但它是爲S1實體返回NULL。 我已經定義了一個以「爲連接查詢選擇實體返回空值」 crComponentDependencyDtls酮關係之間CrComponentRelDependency & 。這個HQL有什麼問題?
嗨波西米亞,感謝您的建議。我嘗試了上面的查詢,但它總是會爲createdDate字段返回一個有效的日期,而爲第二個值返回null。我錯過了什麼嗎? – 2012-04-09 04:36:34
您還沒有發佈足夠的信息讓我進一步提供幫助。事實上,我猜得最多。我不知道你的表格佈局是什麼,也不知道你有什麼數據。 – Bohemian 2012-04-09 12:41:45