[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2464?page=all ]
Steve Ebersole closed HHH-2464:
-------------------------------
Resolution: Rejected
HHH-2471 is a better way
allow SequenceGenerator and TableGenerator to define increment and
initial
---------------------------------------------------------------------------
Key: HHH-2464
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2464
Project: Hibernate3
Type: Improvement
Components: core
Reporter: Steve Ebersole
Assignee: Steve Ebersole
Fix For: 3.2.3
Add two new parameters to SequenceGenerator and TableGenerator as follows:
1) 'initial' - the initial value from which to start generating values. This one
really only has an effect during schema export when creating the underlying structures.
For sequences this would require the sequence to be able to define the "start
with" value ala Oracle. For tables, this would be the value we initially insert into
the table on creation.
2) 'increment' - The number by which values in the underlying DB structure are
incremented. The basic idea is to minimize the number of times we need to hit the
database in order to generate id values. Historically, both SequenceGenerator and
TableGenerator hit the database each and every time an id value is requested. However,
via this increment, we could essentially create a pool of available id values in memory
and use that pool of values as id values. Only when the pool is exhausted would we need
to hit the database. There are 2 aspects to how this new 'increment' param would
affect the implementations:
a) how values would be retrieved from the underlying structure. For sequences, this
would require that the sequences be able to define the increment ('increment by'
in Oracle-speak); it would then take care of the rest of the deatils to this aspect. For
tables, we would need to change the way we perform the updates after value retrieval to
use the increment rather than the 1.
b) return values from this "pool" on calls to #generate(...) as long as values
still exist in the pool; if not rebuild the pool values...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira