Topday we will talk little bit more about the Nhibernate topic. If you are new to this topic than
you can have look at previous post
As its well accepted that Nhibernate is getting really (probably) first choice in applcation development
Its really easy to stary with Nhibernate for a new application development. You have more control
on your application code and its db realtions .
Well this doesnt go as smooth with Legacy DB as new application.
I have legacy database and it has many relations which could drive tyou crazy like anything .
Here in this post I will present a quick but very useful ways to map you WIERED realtions in Nhibernate using fluent Nhibernate.
Here is my small datamodel to explain this kinda of mapping
Above mapping will create a mapping for the ToolLangTbl.
IF you notice int he mapping we have used CompositId to map such mappings.
In such cases always implement GetHashCode and Equal methods as below
If you still have some other wiered database relations and need help to map them ..I can try to help you in it.
Have a nice day ahead !!