我正在使用两个类NiceCustomer和RoughCustomer接口界面ICustomer.
将ICustomer具有四个属性.他们是:
Property Id() As IntegerProperty Name() As StringProperty IsNiceCustomer() As BooleanReadOnly Property AddressFullText() As String我不知道如何将接口映射ICustomer到数据库.
我在内部异常中遇到这样的错误.
关联是指未映射的类:ICustomer
我正在使用Fluent和NHibernate.
小智 -1
在 nhibernate 中映射接口是不可能的。如果您的目标是能够使用通用类型进行查询以检索两种类型的客户,则可以使用多态查询。只需让两个类都实现接口并正常映射类即可。请参阅此参考:
https://www.hibernate.org/hib_docs/nhibernate/html/queryhql.html(第 11.6 节)
| 归档时间: |
|
| 查看次数: |
8090 次 |
| 最近记录: |