How to map an NHibernate entity to a query

核能气质少年 提交于 2019-12-01 21:34:22

One way how to achieve this, would be to move the mapping from a query into the subselect:

<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping default-cascade="save-update" xmlns="urn:nhibernate-mapping-2.2">
  <class name="ThinAir" mutable="false" lazy="true" >

  <subselect>
    <![CDATA[
    SELECT DISTINCT JobID,
    userLogin,
    DateProcessed,
    useremail
    FROM         dbo.someothertable
    ]]>
  </subselect>

  ... // rest of the mapping
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!