Just checked the code from the tools, and it seems the tools doesn't support initialValue nor allocationSize?
It seems the relevant code is in org.hibernate.tool.hbm2x.pojo.EntityPOJOClass in this method:
Code:
private void buildAnnSequenceGenerator(StringBuffer wholeString, Properties properties) {
wholeString.append( "@" + importType("javax.persistence.SequenceGenerator") + "(name=\"generator\", sequenceName=\"" )
.append( properties.getProperty( org.hibernate.id.SequenceGenerator.SEQUENCE, "" ) )
.append( "\")" );
//TODO HA does not support initialValue and allocationSize
wholeString.append( "\n " );
}
would something like this work:
Code:
private void buildAnnSequenceGenerator(StringBuffer wholeString, Properties properties) {
wholeString.append( "@" + importType("javax.persistence.SequenceGenerator") + "(name=\"generator\", sequenceName=\"" )
.append( properties.getProperty( org.hibernate.id.SequenceGenerator.SEQUENCE, "" ) )
.append( "\"
.append(, initialValue="+properties.getProperty("initialValue", "0")
.append(, allocationSize="+properties.getProperty("allocationSize", "0")
.append(")" );
wholeString.append( "\n " );
}
I am using Hibernate CR2, so it might be that the problem has surface because of Hibernate CR2, not the tools?