Support multiple segments in the table structure of SequenceStyleGenerator
Description
Activity
Show:
Details
Details
Assignee
Unassigned
UnassignedReporter

Components
Priority
Created December 27, 2016 at 1:19 PM
Updated December 27, 2016 at 1:19 PM
In Hibernate there are multiple ways to use tables as id generators:
By explicitly using the TableGenerator strategy or as fallback from SequenceStyleGenerator when the underlying dialect doesn't support sequences.
However, there's a difference between the implementation of these two strategies.
While the former allows defining multiple segments (buckets) in one table, The latter use one table for each sequence name which isn't always optimal for the users.
To overcome this I've extended the SequenceStyleGenerator and used a slightly modified TableStructure that takes into account additional parameters an use them in its JDBC queries (just as the original TableGenerator does)
It would be nice if the native sequence generator could be customized in the same way in order to allow finer grained control over the table structure and I'm currently working on a pull request for this feature.
Thanks.