com.ibm.commerce.foundation.server.services.dataaccess.db

Class KeyManager

  • java.lang.Object
    • com.ibm.commerce.foundation.server.services.dataaccess.db.KeyManager


  • public class KeyManager
    extends java.lang.Object
    An integer-based surrogated primary key generation service.
    • Constructor Summary

      Constructors 
      Constructor and Description
      KeyManager(java.lang.String compId)
      Constructs a SDOKeyManager for the component caller.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Long getNextKey(java.lang.String sdoClassName)
      Gets the next key for a table given the SDO class name representing it.
      java.lang.Long getNextKeyForTable(java.lang.String tableName)
      Gets the next key for a table.
      void initializeKeys()
      Initializes the keys in the memory.
      • Methods inherited from class java.lang.Object

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

      • KeyManager

        public KeyManager(java.lang.String compId)
                   throws KeyManagerException
        Constructs a SDOKeyManager for the component caller. It is for IBM internal use only. Use KeyManagerFactory instead.
        Parameters:
        compId - The component ID.
        Throws:
        KeyManagerException
        See Also:
        KeyManagerFactory#getInstance(String)}
    • Method Detail

      • getNextKey

        public java.lang.Long getNextKey(java.lang.String sdoClassName)
                                  throws KeyManagerException
        Gets the next key for a table given the SDO class name representing it. Note that the class name is not fully qualified.
        Parameters:
        sdoClassName - The class name of the SDO data object.
        Returns:
        The next key as an Long object (default).
        Throws:
        KeyManagerException
      • getNextKeyForTable

        public java.lang.Long getNextKeyForTable(java.lang.String tableName)
                                          throws KeyManagerException
        Gets the next key for a table.
        Parameters:
        tableName - The table name.
        Returns:
        The next key as a Long object.
        Throws:
        KeyManagerException
      • initializeKeys

        public void initializeKeys()
        Initializes the keys in the memory. It will be called automatically when this class is not initialized. It should not be called directly by other classes. For IBM internal use only.