c# - Nhibernate Found: integer, Expected INT -
i exception:
nhibernate.hibernateexception: wrong column type in main_command column id. found: integer, expected int
the mapping is:
<id name="id" type="int"> <generator class="identity" /> </id>
and class property is:
public virtual int id { get; set; }
checking nhibernate source sqlite dialect , finding answer similar question. looks signed integer types don't map integer
required sqlite auto increment column.
registercolumntype(dbtype.int16, "smallint"); registercolumntype(dbtype.int32, "int"); registercolumntype(dbtype.int64, "bigint");
but news unsigned ints map integer
.
registercolumntype(dbtype.uint16, "integer"); registercolumntype(dbtype.uint32, "integer"); registercolumntype(dbtype.uint64, "integer");
therefore, please try following mapping:
<id name="id" type="uint32"> <generator class="identity" /> </id>
with corresponding change class:
public virtual uint32 id { get; set; }
Comments
Post a Comment