I've implemented this and my mappings look like the following
<class name="User" table="userTable">
<id name="Id" column="id" unsaved-value="0">
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">userNextHi</param>
</generator>
</id>
...
</class>
<class name="Order" table="userOrder">
<id name="Id" column="id" unsaved-value="0">
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">orderNextHi</param>
</generator>
</id>
...
</class>
Whilst this works fine the SchemaExport does not add both the columns,
only the last one (orderNextHi). Is there a way to make the schema
export pay attention to the extra columns?
Thank you for your help
On Sep 1, 4:44 pm, Fabio Maulo <
fabioma...@gmail.com> wrote:
> a row per entity... have a look to the "where" parameter of the HighLow
> generator.
>
> 2009/9/1 Gareth <
gee-...@hotmail.co.uk>
>
>
>
>
>
> > Ok - what about the good practice, is it a good idea to have a column
> > per entity?
>
> > On Sep 1, 4:28 pm, Tuna Toksoz <
tehl...@gmail.com> wrote:
> > > Hilo range is already _big_
>
> > > On 9/1/09, Gareth <
gee-...@hotmail.co.uk> wrote:
>
> > > > Hi all,
>
> > > > Is it considered a good practice to create a new hilo column for each
> > > > entity i have, eg given two entities Person and Order should my
> > > > hibernate_unique_key table contain two rows 'nextPersonHi', and
> > > > 'nextOrderHi'? In my mind this would give a larger range of id's
> > > > available to the system - although I may be completly wrong and have
> > > > misunderstood the HiLo generator!
>
> > > > Thanks
>
> > > --
>
> > > Tuna Toksöz
> > > Eternal sunshine of the open source mind.
>
> >
http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitt...
>
> --
> Fabio Maulo