com.ibm.tivoli.maximo.dbmanage.connection

Class MaximoSequence

  • java.lang.Object
    • com.ibm.tivoli.maximo.dbmanage.connection.MaximoSequence


  • public class MaximoSequence
    extends java.lang.Object
    This class handles the table sequences on Maximo tables that are used to generate unique ID values.
    See Also:
    Used by the IntegrityCheck, Ought to be used here., Ought to be used here.
    • Constructor Summary

      Constructors 
      Constructor and Description
      MaximoSequence(java.sql.Connection con)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void createSequence(java.lang.String sequenceName, java.lang.Long maxReserved)
      Create the sequence.
      void dropSequence(java.lang.String sequenceName)
      Drops the sequence.
      java.lang.Long getLargestTargetValue(java.lang.String sequenceName)
      Returns the largest value from the columns where the sequence is used.
      boolean sequenceNextValueValid(java.lang.String sequenceName, java.lang.Long nextValue)
      Are there any values greater or equal to the next value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MaximoSequence

        public MaximoSequence(java.sql.Connection con)
                       throws java.sql.SQLException
        Constructor
        Parameters:
        con - A connection to the database. If the database has MT enabled, this should be a MTConnection.
        Throws:
        java.sql.SQLException
    • Method Detail

      • sequenceNextValueValid

        public boolean sequenceNextValueValid(java.lang.String sequenceName,
                                              java.lang.Long nextValue)
                                       throws java.sql.SQLException
        Are there any values greater or equal to the next value.
        Parameters:
        sequenceName -
        nextValue -
        Returns:
        true only if there are no values greater or equal to the next value.
        Throws:
        java.sql.SQLException
      • getLargestTargetValue

        public java.lang.Long getLargestTargetValue(java.lang.String sequenceName)
                                             throws java.sql.SQLException
        Returns the largest value from the columns where the sequence is used. The MaxSequence table is used to find the target columns.
        Parameters:
        sequenceName -
        Returns:
        The largest Long value, or 0L if no values are found
        Throws:
        java.sql.SQLException
      • dropSequence

        public void dropSequence(java.lang.String sequenceName)
                          throws java.sql.SQLException
        Drops the sequence. No exception if the drop fails, usually b/c the sequence doesn't exist.
        Parameters:
        sequenceName -
        Throws:
        java.sql.SQLException
      • createSequence

        public void createSequence(java.lang.String sequenceName,
                                   java.lang.Long maxReserved)
                            throws java.lang.Exception
        Create the sequence. Sequence will have the interval defined by the SEQUENCEINCREMENT MaxVar.
        Parameters:
        sequenceName -
        maxReserved - The starting value of the sequence.
        Throws:
        java.lang.Exception