What are all the NHibernate HiLo generator params?

谁说胖子不能爱 提交于 2020-01-22 19:04:22

问题


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>

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

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


回答1:


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.

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.




回答2:


According to the source, the full list is: "table", "column", "max_lo", "schema", "catalog" and "where", but I don't know if they are all being used. These are defined in classes NHibernate.Id.TableGenerator and NHibernate.Id.TableHiLoGenerator .



来源:https://stackoverflow.com/questions/3942870/what-are-all-the-nhibernate-hilo-generator-params

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!