org.objectweb.jorm.mapper.rdb.adapter.api
Interface SequenceAdapter

All Known Subinterfaces:
RdbAdapter, RdbAdapter
All Known Implementing Classes:
BasicRdbAdapter

public interface SequenceAdapter

Adapter for sequence management.

Author:
S.Chassande-Barrioz

Method Summary
 boolean existSequence(java.sql.Connection connection, java.lang.String seqName)
          checks the sequence existence
 java.lang.String getCreateSequence(java.lang.String seqName)
           
 java.lang.String getCreateSequence(java.lang.String seqName, java.lang.Integer startid, java.lang.Integer increment, java.lang.Integer cache)
           
 void getManyNextValInSequence(java.sql.Connection conn, java.lang.String seqName, int numberOfNextVal)
           
 java.lang.String getNextValInSequence(java.lang.String seqName)
           
 

Method Detail

getCreateSequence

public java.lang.String getCreateSequence(java.lang.String seqName)
                                   throws java.lang.UnsupportedOperationException
Parameters:
seqName - is the sequence name
Returns:
the SQL command to create a sequence
Throws:
java.lang.UnsupportedOperationException

getCreateSequence

public java.lang.String getCreateSequence(java.lang.String seqName,
                                          java.lang.Integer startid,
                                          java.lang.Integer increment,
                                          java.lang.Integer cache)
                                   throws java.lang.UnsupportedOperationException
Parameters:
seqName - is the sequence name
startid - is the initial value of the sequence
increment - is the increment size
cache - is the size of the cache
Returns:
the SQL command to create a sequence
Throws:
java.lang.UnsupportedOperationException

existSequence

public boolean existSequence(java.sql.Connection connection,
                             java.lang.String seqName)
                      throws java.sql.SQLException
checks the sequence existence

Parameters:
connection - is the JDBC connection to use
seqName - is the sequence of the table
Returns:
true if the table exists, otherwise false.
Throws:
java.sql.SQLException

getNextValInSequence

public java.lang.String getNextValInSequence(java.lang.String seqName)
Parameters:
seqName - is the sequence name
Returns:
the SQL command to gett a new value in a SQL sequence which the name is given in parameter.

getManyNextValInSequence

public void getManyNextValInSequence(java.sql.Connection conn,
                                     java.lang.String seqName,
                                     int numberOfNextVal)
                              throws RdbAdapterException
Parameters:
seqName - the sequence name
numberOfNextVal - the number of next val called in the same query
Throws:
RdbAdapterException