本文介绍了带顺序的复合键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我的表中有一个复合键,它的一部分需要通过一个序列生成。

我尝试了以下,但它不工作 - 设置序列名的行似乎将被下面的复合键声明覆盖:
$ b $ pre $ mapping $ Id(x => x.Id).GeneratedBy。序列同一性( SQ_TRANSFORM_ITEMDEL_IDDID);
mapping.CompositeId()。KeyProperty(x => x.Id,ITEMDELIVERYDETAIL_ID)
.KeyReference(x => x.ItemDelivery,ITEMDELIVERY_ID,
PARTITIONDATE );

如何解决这个问题?

解决方案

不要将ItemDelivery映射到CompositeId中,但作为参考请参阅其他问题。总体来说这很容易。


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?

解决方案

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

这篇关于带顺序的复合键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-09 02:20