Howdy folks,
I've a bit of a problem with the TableHiLo generator. It seems to go back to the DB for every new identifier, instead of only going to the DB every MAX_LO identifiers.
I'm certain it's going to the DB because I use P6Spy to view the SQL being issued and it shows up there, also the hibernate debug logs have a line saying "new hi value: X" for every identifier.
I'm pretty sure this used to work, (in fact I'm sure it probably works for everyone else). Unfortunately we're still running 2.0 beta6. We've plans to change that, but we're stuck on it for the moment.
I looked for an issue in JIRA, but no luck. Anyone know what's happening with this, or is it obvious I've done something braindead?
There aren't any properties to set or something that I've missed?
Cheers,
Shorn.
Details:
An abstract id getter method is defined on our root persistent entity and it's mapped with the following details.
The XDoclet mapping looks like this:
Code:
* @hibernate:id unsaved-value = "null" generator-class = "net.sf.hibernate.id.TableHiLoGenerator"
* @hibernate.generator-param name="table" value="cl_id_gen"
* @hibernate.generator-param name="column" value="n_key_next"
And every object has a concreted getter implementation with doco like this:
Code:
* @hibernate:id column = "n_key_case"
The generated hbm.xml looks like this:
Code:
<id
name="id"
column="n_key_case"
type="java.lang.Long"
unsaved-value="null"
>
<generator class="net.sf.hibernate.id.TableHiLoGenerator">
<param name="table">cl_id_gen</param>
<param name="column">n_key_next</param>
</generator>
</id>