More info in this thread because I thought it was a problem in NH
http://groups.google.com/group/nhusers/browse_thread/thread/81e8cffa5a0a0fb4
Class:
public class Entity
{
public virtual Guid Id { get; set; }
public virtual string Content { get; set; }
}
Mapping:
public EntityMap()
{
Id(x => x.Id);
Map(x => x.Content).WithLengthOf(2500);
}
Generates this part in the hbm:
<property name="Content" length="*2500*" type="String">
<column name="Content" />
</property>
And when I run SchemaExport.Create it looks at
column and it has no length defined so length of column in table != 2500
You can also check this test in Fluent
PropertyMapTester.Map_WithFluentLength_OnString_UsesWithLengthOf_PropertyColumnAttribute:
ClassElement.innerXml == "<property name=\"Name\" length=\"20\" type=\"String\"><column name=\"Name\" /></property>"