开发者

Preventing NHibernate foreign key creation for <any> mapping

Is there a way from preventing SchemaExport from generating a foreign key constraint on mapping type? I saw a similar question about mapping, but unfortunately that wont do for . I coul开发者_JAVA技巧dn't find answer to this in NHibernate reference, but maybe someone knows a trick? I'd like to avoid removing constraint afterwards.


Could you post your mappings? <any> definitely does not create foreign keys.

Example:

<any id-type="Guid" meta-type="Int32" name="FooBarOrBaz">
  <meta-value value="1" class="Foo" />
  <meta-value value="2" class="Bar" />
  <meta-value value="3" class="Baz" />
  <column name="FooBarOrBazId" />
  <column name="FooBarOrBazType" />
</any>

This will just create two columns (FooBarOrBazId and FooBarOrBazType), with no FKs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜