Nhibernate 无效的对象名称“休眠\u唯一\u键”

Nhibernate 无效的对象名称“休眠\u唯一\u键”,nhibernate,fluent-nhibernate,Nhibernate,Fluent Nhibernate,尝试保存实体时出现以下错误: 无效的对象名称“休眠\u唯一\u键” 有什么问题? 使用SQL profiler,我有以下查询: 使用updlock、rowlock和hibernate\u unique\u键选择next\u hi 你能帮我吗 我使用的是Asp.NETMVC2,一种具有流畅自动映射的Sharp架构 谢谢你,我找到了。 我需要更改Fluent的PrimaryKeyConvention并设置为native public class PrimaryKeyConvention : IId

尝试保存实体时出现以下错误: 无效的对象名称“休眠\u唯一\u键”

有什么问题? 使用SQL profiler,我有以下查询: 使用updlock、rowlock和hibernate\u unique\u键选择next\u hi

你能帮我吗

我使用的是Asp.NETMVC2,一种具有流畅自动映射的Sharp架构

谢谢你,我找到了。 我需要更改Fluent的PrimaryKeyConvention并设置为native

 public class PrimaryKeyConvention : IIdConvention
{
    public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
    {
        instance.Column("Id");
        instance.UnsavedValue("0");
        //instance.GeneratedBy.HiLo("1000");
        instance.GeneratedBy.Native();
    }
}

谢谢当然,使用本机生成器sql自动增量不是推荐的方法。