Fluent NHibernate 1.1: when multiple column name mappings are used on different classes

天大地大妈咪最大 提交于 2019-12-02 07:25:18

With the help steps you provided and some pray I solved it, adding the KeyColumn!

Id(v => v.numero_cliente, "numero_cliente")
HasMany(v => v.Acionamentos).KeyColumn("numero_cliente").Cascade.All().LazyLoad()

after adding that, then the generated HBM was changed to:

<bag cascade="all" lazy="true" name="Acionamentos" mutable="true">
    <key>
        <column name="numero_cliente" /> 
    </key>
    <one-to-many class="Sistema.CRM.Acionamento, Sistema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> 
</bag>

and no more SQL errors happened.

I am happy that I will be able to use it now! I really did not want to use EF

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