开发者

Does Fluent NHibernate support "trigger-identity"

开发者 https://www.devze.com 2022-12-11 01:40 出处:网络
I posted the question in the Fluent-NHibernate newgroup but so far there ha开发者_运维知识库s been no answer from the void.

I posted the question in the Fluent-NHibernate newgroup but so far there ha开发者_运维知识库s been no answer from the void.

Is there a Fluent NHibernate mapping for the NHibernate "trigger-identity" method of generating primary keys.

Thanks


Just to keep this discussion up-to-date :

this.Id(x => x.Id, "id").GeneratedBy.TriggerIdentity();

-> Fluent NHibernate V.1.1.0.685


Try this:

this.Id(x => x.Id).Column("ID").GeneratedBy.Custom("trigger-identity");


So it turns out that trigger-identity is not currently supported.


So far, the only solution I've found is to use an hbm.xml file for those entities that require trigger-identity generators. However, we ran into another problem when using trigger-identity and "long" ids and our Oracle database . There is a bug where NHibernate does not translate the Id values returned from properly. Here is the JIRA entry:

https://nhibernate.jira.com/browse/NH-1893


I have tried with FluentNHibernate v2.0.50727

Following mapping works fine: this.Id(x => x.Id, "id").GeneratedBy.TriggerIdentity();

Following mapping is not supported anymore: this.Id(x => x.Id).Column("ID").GeneratedBy.Custom("trigger-identity");

0

精彩评论

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