michael wrote:
If everything else fails, coding your own Generator is always an option.
OK, I've tried the increment generator, and looking at the source code, its pretty much doing what we are currently doing manually in our EJB based, non-hibernate project.
However, after the increment generator has found out what the new key value should be, it calls IdentifierGeneratorFactory to create the ID object to return.
Unfortunately, and I think this can be perceived as shortcoming, the IdentifierGeneratorFactory is currently only coded as such "this id generator generates long, integer, short"
Shame really, I'll have to create a new generator, that is 99% the same as the increment one, apart from calling a modified version of IdentifierGeneratorFactory that is capable of returning a BigDecimal.
Who do I ask to get this changed in the next version of hibernate ?
PS Hibernate is fantastic. I reckon 60% of our application is just persistence code. After Hibernate is set up we can probably half our code base !