Composite key with sequence

2019-08-07 18:26发布

I have a composite key in my table and part of it needs to be generated by a sequence.
I tried the following, but it doesn't work - the line that sets the sequence name seems to be overridden by the composite key declaration that follows:

mapping.Id(x => x.Id).GeneratedBy.SequenceIdentity("SQ_TRANSFORM_ITEMDEL_IDDID");
mapping.CompositeId().KeyProperty(x => x.Id, "ITEMDELIVERYDETAIL_ID")
                     .KeyReference(x => x.ItemDelivery, "ITEMDELIVERY_ID",
                                                        "PARTITIONDATE");

How to solve that problem?

1条回答
相关推荐>>
2楼-- · 2019-08-07 19:06

Don't map ItemDelivery in a CompositeId but as a Reference see answer in your other question. It's much easier overall.

查看更多
登录 后发表回答