是否有可能將此sql語句翻譯爲CreateCriteria
,其次是NHibernate涉及ORDER BY COALESCE
?NHibernate COALESCE
SELECT obs1.OBSLOPNR, obs1.LOKALLOPNR, obs2.OBSLOPNR, obs2.LOKALLOPNR
FROM
(SELECT * FROM OBS WHERE OBS.LOKALLOPNR = 9) AS obs1
FULL OUTER JOIN
(SELECT * FROM OBS WHERE OBS.LOKALLOPNR = 8) AS obs2
ON obs1.ARTLOPNR = obs2.ARTLOPNR
ORDER BY COALESCE(obs1.OBSLOPNR, obs2.OBSLOPNR)
像這樣的情況,我們將始終使它成爲一個存儲過程,然後使用session.getNameQuery()來調用該過程。我們爲什麼不讓事情變得簡單? – 2017-08-21 18:26:11