com.jfw.database.oracle
Class Sequence

java.lang.Object
  extended by com.jfw.database.oracle.Sequence
All Implemented Interfaces:
QueryGatewayInterface

public final class Sequence
extends java.lang.Object
implements QueryGatewayInterface

Execute an Oracle sequence for get the next value.

Example

String nextValue = Sequence.get("MY_SEQUENCE_NAME");


Field Summary
static java.lang.String SEQUENCE_ID_KEY
          The key of outputdata HashMap of method execute(java.util.HashMap), associated with the value of the sequence.
static java.lang.String SEQUENCE_NAME_KEY
          The column name with the sequence value.
 
Constructor Summary
Sequence()
           
 
Method Summary
 void execute(java.util.HashMap outputdata)
          Execute the query.
static java.lang.String get(java.lang.String sequence)
          Return the next value of the sequence.
 void setData(java.lang.Object data)
          Set attribute data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEQUENCE_NAME_KEY

public static final java.lang.String SEQUENCE_NAME_KEY
The column name with the sequence value.

See Also:
Constant Field Values

SEQUENCE_ID_KEY

public static final java.lang.String SEQUENCE_ID_KEY
The key of outputdata HashMap of method execute(java.util.HashMap), associated with the value of the sequence.

See Also:
Constant Field Values
Constructor Detail

Sequence

public Sequence()
Method Detail

setData

public void setData(java.lang.Object data)
Set attribute data.

Specified by:
setData in interface QueryGatewayInterface
Parameters:
data - the value of attribute data.

execute

public void execute(java.util.HashMap outputdata)
             throws DatabaseException
Execute the query.

Specified by:
execute in interface QueryGatewayInterface
Parameters:
outputdata - contains data returned by the query.The value of sequence is associated with key SEQUENCE_ID_KEY.
Throws:
DatabaseException

get

public static java.lang.String get(java.lang.String sequence)
                            throws DatabaseException
Return the next value of the sequence.

Parameters:
sequence - the sequence name to use.
Returns:
the next value of the sequence.
Throws:
DatabaseException