开发者

upgrade to NHibernate 3.0.0.1002, Table is not mapped

开发者 https://www.devze.com 2023-01-18 06:10 出处:网络
Yesterday, I upgraded my NHibernate application from 1.2 to 3.0. I get the following exception c.SubContractors is not mapped [SELECT count(distinct c) FROM CallUp c, c.SubContractors sc Where sc.id

Yesterday, I upgraded my NHibernate application from 1.2 to 3.0. I get the following exception

c.SubContractors is not mapped [SELECT count(distinct c) FROM CallUp c, c.SubContractors sc Where sc.id = :id AND c.ChildCallUp IS NULL AND c.State > 0 AND (:start_date BETWEEN c.ContractStartDate AND c.ContractEndDate OR :end_dat开发者_Python百科e BETWEEN c.ContractStartDate AND c.ContractEndDate)]

I can't seem to fix this problem... any suggestion?


The HQL syntax is incorrect. Use:

SELECT count(distinct c) 
FROM CallUp c JOIN c.SubContractors sc 
WHERE sc.id = :id 
AND c.ChildCallUp IS NULL 
AND c.State > 0 
AND (:start_date BETWEEN c.ContractStartDate AND c.ContractEndDate 
     OR :end_date BETWEEN c.ContractStartDate AND c.ContractEndDate)
0

精彩评论

暂无评论...
验证码 换一张
取 消