NHibernate HiLo生成器的所有参数是什么? [英] What are all the NHibernate HiLo generator params?

查看:84
本文介绍了NHibernate HiLo生成器的所有参数是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过Fabio Maulo的一些文档,这些文档显示了以下参数:

I've seen some docs by Fabio Maulo that shows the following params:

<id name="Id" type="Int64" column="cat_id">
    <generator class="hilo">
            <param name="table">hi_value</param>
            <param name="column">next_value</param>
            <param name="max_lo">100</param>
    </generator>
</id>

但是,在此问题上,发布者使用了<param name="schema">...我希望能够为HiLo指定架构发电机.

However, on this question the poster uses a <param name="schema">... I'd like to be able to specify schema for the HiLo generator.

是否有关于所有发生器参数的明确文档?我尝试使用Google搜索,但没有成功.

Is there definitive documentation for all generator parameters? I've tried googling it without success.

推荐答案

要添加到混合中的另一个参数是

Another param to throw in the mix is

<param name="where">TableName='CmsLogin'</param>

这使您能够对每个实体使用不同的计数器,而不是对所有实体使用计数器.

This gives you the ability to have different counters per entity rather than a counter for all entities.

但是我还没有找到一种将模式指定为参数的方法,因此我认为您需要为数据库中的每个唯一模式创建一个单独的HiLo Key表.

However I have not seen a way to specify the schema as a param so I think you need to go with creating a separate HiLo Key table for each unique schema in the database.

这篇关于NHibernate HiLo生成器的所有参数是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆