0

I have 3 tables that represents a many to many mapping. Two tables with different ids and a third table with a composite key referencing the other two.

How can i map this using the classmap in nhibernate?

The following doesn´t work:

HasManyToMany(m =>
                    m.ListBlockStatus)
                    .Table("BlockTypeAction")
                    .ParentKeyColumn("IdBlockActionDefinition")
                    .ChildKeyColumn("IdBlockTypeCategory")
                    .Table("BlockTypeCategory")
                    .ParentKeyColumn("Id");

1 Answer 1

1

Found what i need, unfortunately the query in the end is not an inner join.

            HasManyToMany(m => m.ListBlockStatus)
            .Table("BlockTypeAction")
            .ChildKeyColumns.Add("IdBlockActionDefinition")
            .ParentKeyColumn("IdBlockTypeCategory")
            .Cascade.All();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.