deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io
Class GenericSQLIDGenerator

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

 class GenericSQLIDGenerator
extends java.lang.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)  java.sql.Connection con
           
(package private)  java.lang.String fieldName
           
(package private)  int fieldType
           
(package private)  boolean isNumeric
           
(package private)  java.lang.String tableName
           
 
Constructor Summary
GenericSQLIDGenerator(java.sql.Connection con, java.lang.String tableName, java.lang.String fieldName, int fieldType, boolean isNumeric)
          Constructs a new GenericSQLIDGenerator.
 
Method Summary
 java.lang.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

java.sql.Connection con

fieldType

int fieldType

isNumeric

boolean isNumeric

tableName

java.lang.String tableName

fieldName

java.lang.String fieldName
Constructor Detail

GenericSQLIDGenerator

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

Parameters:
con -
fieldType -
Method Detail

generateUniqueId

public java.lang.Object generateUniqueId()
                                  throws java.sql.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:
java.sql.SQLException - if for some reason a problem was encountered

deegree 2.5 (2011/06/29 09:44 build-8-official)

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