Length constraint of column is ignored when running SchemaExport.Create

*Class:*
public class Entity
{
  public virtual Guid Id { get; set; }
  public virtual string Content { get; set; }
}

*Mapping file:*
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="true"
assembly="PropertyLengthTest" namespace="PropertyLengthTest.Domain">
  <class name="Entity" table="`Entity`" xmlns="urn:nhibernate-mapping-2.2">
    <id name="Id" column="Id" type="Guid">
      <generator class="guid.comb" />
    </id>
    <property name="Content" length="*2500*" type="String">
      <column name="Content" />
    </property>
  </class>
</hibernate-mapping>

*Successful test:*
[Test]
public void
When_generating_schema_should_generate_correct_length_of_property()
{
  var configuration = new Configuration();
  configuration.Configure();
  configuration.AddAssembly(typeof (Entity).Assembly);
  var export = new SchemaExport(configuration);
  export.Drop(true, true);
  export.Create(true, true);
}

*Generated table:*
CREATE TABLE [dbo].[Entity](
  [Id] [uniqueidentifier] NOT NULL,
  [Content] [nvarchar](*255*) ...

*NHibernate version:* 2.1.0.1001

Any ideas?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to