com.opencms.dbpool
Class CmsIdGenerator

java.lang.Object
  |
  +--com.opencms.dbpool.CmsIdGenerator

public class CmsIdGenerator
extends Object

This class is used to create OpenCms system-IDs.

Author:
Andreas Schouten

Constructor Summary
CmsIdGenerator()
           
 
Method Summary
static int nextId(String tableName)
          Creates a new id for the given table.
static int nextId(String poolName, String tableName)
          Creates a new id for the given table.
static void setDefaultPool(String poolName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsIdGenerator

public CmsIdGenerator()
Method Detail

setDefaultPool

public static void setDefaultPool(String poolName)

nextId

public static int nextId(String tableName)
                  throws CmsException
Creates a new id for the given table.

Parameters:
tableName - - the name of the table to create the id.
Returns:
the next id for this resource.
CmsException

nextId

public static int nextId(String poolName,
                         String tableName)
                  throws CmsException
Creates a new id for the given table.

Parameters:
tableName - - the name of the table to create the id.
Returns:
the next id for this resource.
CmsException