views:

184

answers:

2

Is there a way in fluent nhibernate (or possibly NHibernate in general) to tell it to generate the primary keys differently? It creates the column name for the key fine, but the index/constraint gets weird generated names like:

PK_Address_3214EC2725332734

PK_CreditCa_3214EC2756CA82C8

etc...

I can use straight sql to rename them but i'd rather not.

thanks, all

+2  A: 

You should be able to name all constraints thus:

http://marcinobel.com/index.php/fluent-nhibernate-conventions-examples/

Hope this helps, I checked with some colleagues...

gbn
A: 

This is a similar question to this:

http://stackoverflow.com/questions/1358043/fluent-nhibernate-primary-key-constraint-naming-conventions

It doesn't seem possible to do it because NHibernate itself doesn't support it.

(I was irked to find out).

Reiste