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

org.deegree.io
Class GenericSQLIDGenerator

java.lang.Object
  extended by org.deegree.io.GenericSQLIDGenerator
All Implemented Interfaces:
DataBaseIDGenerator

 class GenericSQLIDGenerator
extends Object
implements DataBaseIDGenerator

Primary key generator for generic JDBC-connections.

NOTE: At the moment, every application has to take care of locking the table to prevent problems in multithreaded or multihosted applications.

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

Field Summary
(package private)  Connection con
           
(package private)  String fieldName
           
(package private)  int fieldType
           
(package private)  boolean isNumeric
           
(package private)  String tableName
           
 
Constructor Summary
GenericSQLIDGenerator(Connection con, String tableName, String fieldName, int fieldType, boolean isNumeric)
          Constructs a new GenericSQLIDGenerator.
 
Method Summary
 Object generateUniqueId()
          Generates a new id, suitable as a primary key for the next dataset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

con

Connection con

fieldType

int fieldType

isNumeric

boolean isNumeric

tableName

String tableName

fieldName

String fieldName
Constructor Detail

GenericSQLIDGenerator

GenericSQLIDGenerator(Connection con,
                      String tableName,
                      String fieldName,
                      int fieldType,
                      boolean isNumeric)
Constructs a new GenericSQLIDGenerator.

Parameters:
con -
fieldType -
Method Detail

generateUniqueId

public Object generateUniqueId()
                        throws SQLException
Generates a new id, suitable as a primary key for the next dataset.

Specified by:
generateUniqueId in interface DataBaseIDGenerator
Returns:
Id, the object type depends on the database field used as primary key
Throws:
SQLException - if for some reason a problem was encountered

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