Skip to content


Bug when trying to change varchar length for CompositeId #200

phinoppix opened this Issue · 6 comments

3 participants


I am using Firebird 2.5 with FluentNH 1.3. Database is UTF8 encoded. Below is my composite id mapping:

.KeyProperty(e => e.TransactId, "TransactId")
.KeyProperty(e => e.TransactType, p =>
.KeyReference(e => e.Entity, "EntityId");

NH creates the TType field as varchar(255). The generated hbm is...

< composite-id>
< key-property name="TransactId" type="Int64">
< column name="TransactId" />
< /key-property>
< key-property name="TransactType" type="String" length="2">
< column name="TransactType" />
< /key-property>
< key-many-to-one name="Entity" type="Int64">
< column name="EntityId" />
< /key-many-to-one>
< /composite-id>

Note that the TransactId and EntityId fields are bigint, adding the varchar(255) UTF8 exceeds Firebird's index length. If the length attribute is on the element, the composite id is created correctly.


I have the same issue with MSSQL. HBM generated contains the correct length specified in mapping of the KeyProperty but looking at generated schema I see varchar(255).


then may be it's NHibernate problem? Because NH generates DDL itself, Fluent is just a convenient way to do the mapping without xml


will have a look tomorrow


Really need to learn to keep my promises - I will research this, guys.


The problem is confirmed, but I believe it's on NHibernate side. They don't have a ticket for this currently, so I took a liberty of creating one


I'm going to close this for now. Let's see what guys from NH team can come up with

@chester89 chester89 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.