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

Interface SequenceAdapter

Known Subinterfaces:
RdbAdapter, RdbAdapter
Known Implementing Classes:
BasicRdbAdapter, CloudscapeAdapter, Db2Adapter, FirebirdAdapter, HsqlAdapter, MckoiAdapter, MysqlAdapter, Oracle8Adapter, OracleAdapter, PostgresAdapter, ProgressAdapter, SapdbAdapter, SqlserverAdapter, SybaseAdapter

public interface SequenceAdapter

Adapter for sequence management.

Author:
S.Chassande-Barrioz

Method Summary

boolean
existSequence(Connection connection, String seqName)
checks the sequence existence
String
getCreateSequence(String seqName)
String
getCreateSequence(String seqName, Integer startid, Integer increment, Integer cache)
String
getNextValInSequence(String seqName)

Method Details

existSequence

public boolean existSequence(Connection connection,
                             String seqName)
            throws 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.


getCreateSequence

public String getCreateSequence(String seqName)
            throws UnsupportedOperationException

Parameters:
seqName - is the sequence name

Returns:
the SQL command to create a sequence


getCreateSequence

public String getCreateSequence(String seqName,
                                Integer startid,
                                Integer increment,
                                Integer cache)
            throws 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


getNextValInSequence

public String getNextValInSequence(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.