c# - Unit testing NHibernate Postgresql with SQLite. Sequence generator problem -
can sqlite nhibernate id generator made compatible postgresql? i'm planning unit test nhibernate postgresql project based on http://ayende.com/blog/archive/2009/04/28/nhibernate-unit-testing.aspx
if there no compatible id generator, there way signal nhibernate ignore id generator when using different dialect?
<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 ignored when using different dialect.. --> <generator class="sequence"> <param name="sequence">blog_id_seq</param> </generator> <!-- ...can --> </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>
error when using sqlite dialect on postgresql-specific mapping:
nhibernate.mappingexception: not instantiate id generator: sequence ---> nhibernate.mappingexception: dialect not support sequences
my suggestion use db-agnostic generator, hilo
.
Comments
Post a Comment