NHibernate Mapping

1

How do I map a table that has a compound key in NHibernate?

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

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

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

    
asked by anonymous 28.11.2016 / 17:35

1 answer

0

Try this

CompositeId ()     .KeyReference (x => x.FilialId, "id_filial")     .KeyReference (x => x.LocalId, "local_id");

    
29.11.2016 / 17:51