org.objectweb.telosys.dal.dao
Class SequenceDAO

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.dal.dao.SequenceDAO

public class SequenceDAO
extends TelosysObject


Field Summary
static int MYSQL
           
static int ORACLE
           
static int POSTGRESQL
           
static int UNKNOWN
           
 
Constructor Summary
SequenceDAO(java.lang.String sSequenceName, int iBaseType)
           
 
Method Summary
 long currVal(java.sql.Connection con)
          Get the 'currval' of the sequence (using the given database connection)
 long currVal(DatabaseSession session)
          Get the 'currval' of the sequence (using the given database session)
 int getDatabaseType()
          Returns the database type
 java.lang.String getSequenceName()
          Returns the name of the sequence
 java.lang.String getSqlCurrVal()
          Returns the SQL request used to get 'currval'
 java.lang.String getSqlNextVal()
          Returns the SQL request used to get 'nextval'
 long nextVal()
          Get the 'nextval' of the sequence (using the default database)
 long nextVal(java.sql.Connection con)
          Get the 'nextval' of the sequence (using the given database connection)
 long nextVal(DatabaseSession session)
          Get the 'nextval' of the sequence (using the given database session)
 long nextVal(int iDatabaseId)
          Get the 'nextval' of the sequence (using the given database id)
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

ORACLE

public static final int ORACLE
See Also:
Constant Field Values

POSTGRESQL

public static final int POSTGRESQL
See Also:
Constant Field Values

MYSQL

public static final int MYSQL
See Also:
Constant Field Values
Constructor Detail

SequenceDAO

public SequenceDAO(java.lang.String sSequenceName,
                   int iBaseType)
Method Detail

getSequenceName

public java.lang.String getSequenceName()
Returns the name of the sequence

Returns:

getDatabaseType

public int getDatabaseType()
Returns the database type

Returns:

getSqlNextVal

public java.lang.String getSqlNextVal()
Returns the SQL request used to get 'nextval'

Returns:

getSqlCurrVal

public java.lang.String getSqlCurrVal()
Returns the SQL request used to get 'currval'

Returns:

nextVal

public long nextVal()
             throws TelosysException
Get the 'nextval' of the sequence (using the default database)

Returns:
: the Sequence 'NextVal'
Throws:
TelosysException

nextVal

public long nextVal(int iDatabaseId)
             throws TelosysException
Get the 'nextval' of the sequence (using the given database id)

Parameters:
iDatabaseId - : the database id to use
Returns:
: the Sequence 'NextVal'
Throws:
TelosysException

nextVal

public long nextVal(DatabaseSession session)
             throws TelosysException
Get the 'nextval' of the sequence (using the given database session)

Parameters:
session - : the database session to use
Returns:
: the Sequence 'NextVal'
Throws:
TelosysException

nextVal

public long nextVal(java.sql.Connection con)
             throws TelosysException
Get the 'nextval' of the sequence (using the given database connection)

Parameters:
con - : the connection to use
Returns:
: the Sequence 'NextVal'
Throws:
TelosysException

currVal

public long currVal(DatabaseSession session)
             throws TelosysException
Get the 'currval' of the sequence (using the given database session)

Parameters:
session - : the database session to use
Returns:
: the Sequence 'currval'
Throws:
TelosysException

currVal

public long currVal(java.sql.Connection con)
             throws TelosysException
Get the 'currval' of the sequence (using the given database connection)

Parameters:
con - : the connection to use
Returns:
: the Sequence 'currval'
Throws:
TelosysException