I have a situation where I have tables that have many columns used as a composite primary key,
worse off business logic requires these to be mutable.
I am using nhibernate and have no problems mapping for loadig/saving these. However I need to be able to update the property values and have these changes be reflected in the DB when i call update.
This is a legacy system so there is no changing of the db structure(its horrible).
Is there anything I can do with nhibernate to resolve this problem ? does nhibernate even allow its keys to be modified.
I am using: .net4.0, nhibernate 2.1, fluentnh 1.0, and sql server as the backend.
You can't change the PK with NHibernate. As you've already figured out, the structure you are dealing with is just horrible.
What you can do is use SQL queries to change the PK. Keep in mind you'll have to reload the entity with the new id before using it again.