org.pf.db.util
Class ObjectIdentifierDB

java.lang.Object
  extended by org.pf.text.ObjectIdGenerator
      extended by org.pf.db.util.ObjectIdentifierGenerator
          extended by org.pf.db.util.ObjectIdentifierDB
All Implemented Interfaces:
org.pf.bif.identifier.IObjectIdGenerator, ObjectIdentifierProducer, org.pfsw.text.StringGenerator

public class ObjectIdentifierDB
extends ObjectIdentifierGenerator

Instances of this class provide generation of unique identifiers backed by a specific database table. That means the next available id will be always updated in the database.

Version:
1.5
Author:
M.Duchrow

Constructor Summary
ObjectIdentifierDB(DataSource ds)
          Initialize the new instance with the given data source.
ObjectIdentifierDB(DataSource ds, String categoryName)
          Initialize the new instance with the data source.
ObjectIdentifierDB(String tableQualifier, DataSource ds)
          Initialize the new instance with the given data source.
ObjectIdentifierDB(String tableQualifier, DataSource ds, String categoryName)
          Initialize the new instance with the data source.
 
Method Summary
 int getBlockSize()
          Returns the block size this generator is using.
 void setBlockSize(int newValue)
          Set the block size this generator is using.
 
Methods inherited from class org.pf.text.ObjectIdGenerator
generateString, generateString, getFullLength, getLength, getPadChar, getPrefix, hasPrefix, newIdentifier, nextIdentifier, setLength, setPadChar, setPrefix
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pf.db.util.ObjectIdentifierProducer
nextIdentifier
 
Methods inherited from interface org.pf.bif.identifier.IObjectIdGenerator
newIdentifier
 

Constructor Detail

ObjectIdentifierDB

public ObjectIdentifierDB(DataSource ds)
Initialize the new instance with the given data source.

Parameters:
ds - A valid data source that allows connection to a database

ObjectIdentifierDB

public ObjectIdentifierDB(String tableQualifier,
                          DataSource ds)
Initialize the new instance with the given data source.

Parameters:
tableQualifier - A qualifier that is put in front of the table name
ds - A valid data source that allows connection to a database

ObjectIdentifierDB

public ObjectIdentifierDB(DataSource ds,
                          String categoryName)
Initialize the new instance with the data source. Assign a category where the OIDs belong to.

Parameters:
ds - A valid data source that allows connection to a database
categoryName - The name of the OID's category

ObjectIdentifierDB

public ObjectIdentifierDB(String tableQualifier,
                          DataSource ds,
                          String categoryName)
Initialize the new instance with the data source. Assign a category where the OIDs belong to.

Parameters:
tableQualifier - A qualifier that is put in front of the table name
ds - A valid data source that allows connection to a database
categoryName - The name of the OID's category
Method Detail

getBlockSize

public int getBlockSize()
Returns the block size this generator is using.


setBlockSize

public void setBlockSize(int newValue)
Set the block size this generator is using.



Copyright © 2014 Manfred Duchrow Consulting & Software. All rights reserved.