Fluent NHibernate - specify table and column names when using HiLo generator

Yes, nit-picky is a good way to describe it ...;)

Does anyone know if you can specify table and / or column names to use HiLo using Fluent NHibernate? Currently exporting the schema creates this ...

create table hibernate_unique_key (
     next_hi INTEGER 
)

      

+2


source to share


1 answer


Found it out ...



public class IdGenerationConvention : IIdConvention
{
    public void Apply(IIdentityInstance instance)
    {
        instance.GeneratedBy.HiLo("MyTableName", "NextHighValue", "1000");
    }
}

      

+3


source







All Articles