Having trouble mapping HBM to FluentNHibernate mappings for many-to-many?

How to map IDictionary in Fluent Nbernate One problem I see is the use of the Element in your manytomany. That's probably why you don't get any foreign key setup for profile_id. Also, if possible, I'd try adding a public accessor for profilesMap To match your case, I'd make your mapping as follows: HasManyToMany(ProfilesMap) //Assuming the addition of a public get accessor .Access.CamelCaseField() .

ParentKeyColumn("User_Id") . ChildKeyColumn("Profile_Id") . Table("User_Profile") .

AsMap("Id") If you can't add the accessor you can try this HasManyToMany(Reveal. Member("profilesMap")) . Table("User_Profile") .

ParentKeyColumn("User_id") . ChildKeyColumn("Profile_id") . AsMap("`Order`").

How to map IDictionary in Fluent Nbernate One problem I see is the use of the Element in your manytomany. That's probably why you don't get any foreign key setup for profile_id. Also, if possible, I'd try adding a public accessor for profilesMap.

To match your case, I'd make your mapping as follows: HasManyToMany(ProfilesMap) //Assuming the addition of a public get accessor .Access.CamelCaseField() . ParentKeyColumn("User_Id") . ChildKeyColumn("Profile_Id") .

Table("User_Profile") . AsMap("Id"); If you can't add the accessor you can try this HasManyToMany(Reveal. Member("profilesMap")) .

Table("User_Profile") . ParentKeyColumn("User_id") . ChildKeyColumn("Profile_id") .

AsMap("`Order`").

Perfect! Having the second type parameter to Reveal. Member as object really did the trick to clear things up (along with the parent/child key columns).

I owe you more than just an up vote! Cheers! – TheCloudlessSky Aug 20 at 2:20 Also - I hope you don't mind but I edited your answer to directly map to the solution of the OP.

Thanks again! – TheCloudlessSky Aug 20 at 2:27.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions