Nhibernate中有多个主键?

Nhibernate中有多个主键?,nhibernate,orm,mapping,Nhibernate,Orm,Mapping,在NHibernate中映射时如何分配多个主键 Id(x => x.TopicID); <<----Primary Key Map(x => x.Topic); <<---Should Also be a Primary Key Map(x => x.Subtitle); Map(x => x.Description); Map(x => x.ImageURL);

在NHibernate中映射时如何分配多个主键

    Id(x => x.TopicID); <<----Primary Key
        Map(x => x.Topic);   <<---Should Also be a Primary Key
        Map(x => x.Subtitle);
        Map(x => x.Description);
        Map(x => x.ImageURL);

    }

使用CompositeID方法:

CompositeId()
.KeyProperty(x => x.TopicId, "name")
.KeyReference(x => x.Topic, "anotherName");

主题不是对象,不是ID吗?p、 你真的应该标记一些被接受的答案——你已经问了12个问题,但没有接受任何一个问题——这对你的声誉不好。你是指复合键还是——正如这个词所暗示的——备用键?