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...
< key-property name="TransactId" type="Int64">
< column name="TransactId" />
< key-property name="TransactType" type="String" length="2">
< column name="TransactType" />
< key-many-to-one name="Entity" type="Int64">
< column name="EntityId" />
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 https://nhibernate.jira.com/browse/NH-3400
I'm going to close this for now. Let's see what guys from NH team can come up with