本文介绍了NHibernate HiLo-每个实体的新列和HiLo捕获的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前正在为我的班级使用hilo id生成器,但仅使用了最少的设置,例如
I'm currently using the hilo id generator for my classes but have just been using the minimal of settings eg
<class name="ClassA">
<id name="Id" column="id" unsaved-value="0">
<generator class="hilo" />
</id>
...
但是我真的应该为NHibernate指定一个新列以使用foreach实体并为其提供最大lo吗?
But should I really be specifying a new column for NHibernate to use foreach entity and providing it with a max lo?
<class name="ClassA">
<id name="Id" column="id" unsaved-value="0">
<generator class="hilo">
<param name="table">hibernate_unique_key</param>
<param name="column">classA_nexthi</param>
<param name="max_lo">20</param>
</generator>
</id>
...
<class name="ClassB">
<id name="Id" column="id" unsaved-value="0">
<generator class="hilo">
<param name="table">hibernate_unique_key</param>
<param name="column">classB_nexthi</param>
<param name="max_lo">20</param>
</generator>
</id>
...
我还注意到,当我执行上述操作时,SchemaExport不会创建所有列-仅classB_nexthi,还有其他我在做错的事情.
Also I've noticed that when I do the above the SchemaExport will not create all the columns - only classB_next is there something else I'm doing wrong.
推荐答案
我再次问了这个问题,但在nhusers组中,请在此处查看响应我得到
I asked this question again but in the nhusers group, see here for response i got
这篇关于NHibernate HiLo-每个实体的新列和HiLo捕获的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!