We are seeing a small issue with the MSSQL2000 dialect. I will try to explain the best I can.
We have a class with a mapping file like this:
<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="Example.Demo, Example" table="Example" mutable="true"> <id name="Id" type="Int32" unsaved-value="0"> <column name="id" not-null="true" unique="true" index="PK_Example"/> <generator class="native" /> </id> <property name="Created" type="DateTime"> <column name="created" not-null="false"/> </property> <property name="Updated" type="DateTime"> <column name="updated" not-null="false"/> </property> <property name="Title" type="AnsiString"> <column name="title" length="100" not-null="false"/> </property> <property name="Description" type="AnsiString"> <column name="description" length="255" not-null="false"/> </property> <property name="Content" type="StringClob" > <column name="content" length="2147483647" not-null="false"/> </property> </class> </hibernate-mapping>
When we use SchemaExport.Create(), the "Content" / StringClob column gets generated as a nvarchar(255). This appears to be a default representation of the column. I added the following line to the MSSQL2000 dialect to attempt to resolve the problem for us but I am not sure if this is the best approach (i.e. is there a way to improve my mapping file):
RegisterColumnType( DbType.String, 2147483647, "TEXT" ); // HACK TO TEMP. FIX TEXT DEFAULTING TO NVARCHAR(255)
Any help is appreciated.
|