使用Fluent Nhibernate将nhibernate自定义类型映射到参数 [英] Mapping nhibernate custom types with parameters using Fluent Nhibernate

查看:133
本文介绍了使用Fluent Nhibernate将nhibernate自定义类型映射到参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个nhibernate自定义类型,我想用Fluent NHibernate映射。
$ b HBM映射看起来像这样。

 < property name =DateConventionaccess =nosetter.camelcase-underscorecolumn =date_conventionnot-null =true> 
< type name =DataAccess.Types.DateConventionCustomType,Services.DataAccess>
< param name =type> Services.Data.DateConventionTypeParameter,Services.Data< / param>
< / type>
< / property>

我已成功映射自定义类型,但找不到配置参数的方法在自定义类型映射上。



有没有一种方法可以使用流利的nhibernate来映射这个函数?

解决方案

Fluent NHibernate没有公开这个功能,但是你可以使用hbm.xml文件作为需要它的映射,剩下的就用ClassMap。


I have an nhibernate custom type that I would like to map with Fluent NHibernate.

The HBM mapping looks like this.

<property name="DateConvention" access="nosetter.camelcase-underscore" column="date_convention" not-null="true">
  <type name="DataAccess.Types.DateConventionCustomType, Services.DataAccess">
    <param name="type">Services.Data.DateConventionTypeParameter, Services.Data</param>
  </type>
</property>

I have successfully mapped the custom type, but I cannot find a way to configure the parameters on the custom type mapping.

Is there a way to map this using fluent nhibernate ?

解决方案

Fluent NHibernate does not expose this capability, but you can use hbm.xml files for the mappings that need it and use ClassMap for the rest.

这篇关于使用Fluent Nhibernate将nhibernate自定义类型映射到参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆