Bug when trying to change varchar length for CompositeId #200

Closed
phinoppix opened this Issue Dec 26, 2012 · 6 comments

Comments

Projects
None yet
3 participants
@phinoppix

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

CompositeId()
.KeyProperty(e => e.TransactId, "TransactId")
.KeyProperty(e => e.TransactType, p =>
{
p.ColumnName("TType");
p.Length(2);
})
.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.

@jasminsehic

This comment has been minimized.

Show comment
Hide comment
@jasminsehic

jasminsehic Jan 23, 2013

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).

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).

@chester89

This comment has been minimized.

Show comment
Hide comment
@chester89

chester89 Jan 23, 2013

Collaborator

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

Collaborator

chester89 commented Jan 23, 2013

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

@chester89

This comment has been minimized.

Show comment
Hide comment
@chester89

chester89 Feb 4, 2013

Collaborator

will have a look tomorrow

Collaborator

chester89 commented Feb 4, 2013

will have a look tomorrow

@chester89

This comment has been minimized.

Show comment
Hide comment
@chester89

chester89 Feb 14, 2013

Collaborator

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

Collaborator

chester89 commented Feb 14, 2013

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

@chester89

This comment has been minimized.

Show comment
Hide comment
@chester89

chester89 Feb 15, 2013

Collaborator

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

Collaborator

chester89 commented Feb 15, 2013

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

@chester89

This comment has been minimized.

Show comment
Hide comment
@chester89

chester89 Apr 10, 2013

Collaborator

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

Collaborator

chester89 commented Apr 10, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment