net.sf.derquinsej.hib3.seq
Class Sequence

java.lang.Object
  extended by net.sf.derquinsej.hib3.seq.Sequence

@Entity
public class Sequence
extends Object

Entity representing database row-backed sequences. The use of these kind of sequences is the possibility of using them transactionally. WARNING: Transactional sequences are a source of locks and may hurt scalability.

Author:
Andres Rodriguez

Constructor Summary
Sequence()
          Default constructor.
 
Method Summary
 long getCurrent()
          Returns the current value of the sequence.
 String getId()
          Returns the name of the sequence.
 long getIncrement()
          Returns the increment to use in the sequence.
 void setIncrement(long increment)
          Sets the new increment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sequence

public Sequence()
Default constructor.

Method Detail

getId

public String getId()
Returns the name of the sequence.

Returns:
The name of the sequence.

getCurrent

public long getCurrent()
Returns the current value of the sequence.

Returns:
The current value of the sequence.

getIncrement

public long getIncrement()
Returns the increment to use in the sequence.

Returns:
The increment to use in the sequence.

setIncrement

public void setIncrement(long increment)
Sets the new increment. It must be same sign and greater absolute value then the old one.

Parameters:
increment - The new increment.


Copyright © 2012. All Rights Reserved.