@SequenceGenerator - allocationSize, reverse engineering with Eclipse Hibernate Tools

Posted by Spooky on Stack Overflow See other posts from Stack Overflow or by Spooky
Published on 2010-05-17T08:34:52Z Indexed on 2010/05/17 8:41 UTC
Read the original article Hit count: 271

I use the Eclipse Hibernate Tools to create domain classes with JPA annotations from my Oracle database. To control sequence generation I have added the following entry to the hibernate.reveng.xml:

...
<primary-key>
<generator class="sequence">
<param name="sequence">SEQ_FOO_ID</param>
</generator>
</primary-key>
...

This results in the following annotation:

@SequenceGenerator(name = "generator", sequenceName = "SEQ_FOO_ID")

However I need to set the "allocationSize" like this:

@SequenceGenerator(name = "generator", sequenceName = "SEQ_FOO_ID", allocationSize = 1)

Is it possible to set this somehow in the hibernate.reveng.xml?

© Stack Overflow or respective owner

Related posts about eclipse

Related posts about hibernate