deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.io.datastore.sql.idgenerator
Class DBSeqIdGenerator

java.lang.Object
  extended by org.deegree.io.datastore.idgenerator.IdGenerator
      extended by org.deegree.io.datastore.sql.idgenerator.DBSeqIdGenerator

public class DBSeqIdGenerator
extends IdGenerator

Feature id generator that uses an SQL sequence to create new values.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Markus Schneider , last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from class org.deegree.io.datastore.idgenerator.IdGenerator
ft, params, TYPE_UUID
 
Constructor Summary
DBSeqIdGenerator(Properties params)
          Creates a new DBSeqIdGenerator instance.
 
Method Summary
 Object getNewId(DatastoreTransaction ta)
          Returns a new primary key.
 FeatureId getNewId(MappedFeatureType ft, DatastoreTransaction ta)
          Returns a new id for a feature of the given type.
 String getSequenceName()
          Returns the name of the used sequence.
 
Methods inherited from class org.deegree.io.datastore.idgenerator.IdGenerator
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBSeqIdGenerator

public DBSeqIdGenerator(Properties params)
                 throws IdGenerationException
Creates a new DBSeqIdGenerator instance.

Supported configuration parameters:

Name optional? Usage
sequence no name of the SQL sequence to be used
offset yes integer value, if omitted the next value of the sequence is used (default)
otherwise the current value + offset is used

Parameters:
params - configuration parameters
Throws:
IdGenerationException
Method Detail

getSequenceName

public String getSequenceName()
Returns the name of the used sequence.

Returns:
the name of the used sequence

getNewId

public Object getNewId(DatastoreTransaction ta)
                throws IdGenerationException
Returns a new primary key.

Specified by:
getNewId in class IdGenerator
Parameters:
ta - datastore transaction (context)
Returns:
a new primary key.
Throws:
IdGenerationException - if the generation of the id could not be performed

getNewId

public FeatureId getNewId(MappedFeatureType ft,
                          DatastoreTransaction ta)
                   throws IdGenerationException
Returns a new id for a feature of the given type.

Specified by:
getNewId in class IdGenerator
Parameters:
ft - (mapped) feature type
ta - datastore transaction (context)
Returns:
a new feature id.
Throws:
IdGenerationException - if the generation of the id could not be performed

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org