Mappingnhibernate

Asked

Viewed 111 times

1

How do I map a table that has a composite key in Nhibernate?

For example: I have a table called configuracao. This table has a reference to the table local_estoque. Normally a map would look like this:

References(x => x.Local_Estoque_Ordem_Servico, "id_local_ordem_servico");

However, in the table local_estoque the primary key is composed ("id_filial" e "id_local_estoque). What is the mapping for this case?

  • See the override in the equals class cited in the answer to this question to resolve this from the composite key http://answall.com/questions/111337/mappingfluent-chave-composta-nhibernate-com-banco-firebird

1 answer

0

Try this

Compositeid() . Keyreference(x => x.Filialid, "id_filial") . Keyreference(x => x.Localid, "id_local");

Browser other questions tagged

You are not signed in. Login or sign up in order to post.