可以将Sqlite NHibernate id生成器与Postgresql兼容吗?我计划基于此对我的NHibernate Postgresql项目进行单元测试。如果没有兼容的id生成器,是否有办法在使用不同方言时通知NHibernate忽略id生成器?http://ayende.com/Blog/archive/2009/04/28/nhibernate-unit-testing.aspx
使用Sqlite方言时在Postgresql特定映射上出现错误:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" auto-import="true" assembly="RuntimeNhibernate" namespace="RuntimeNhibernate" >
<class name="Blog" table="blog">
<id name="BlogId" column="blog_id">
<!-- can this be ignored when using different dialect.. -->
<generator class="sequence">
<param name="sequence">blog_id_seq</param>
</generator>
<!-- ...can this -->
</id>
<property name="AllowsComments" column="allows_comments"/>
<property name="CreatedAt" column="created_at"/>
<property name="Subtitle" column="subtitle"/>
<property name="Title" column="title"/>
</class>
</hibernate-mapping>
使用Sqlite方言时在Postgresql特定映射上出现错误:
NHibernate.MappingException: could not instantiate id generator: sequence --->
NHibernate.MappingException: Dialect does not support sequences