de.uplanet.lucy.server.businesslogic.util
Class UniqueNumberGenerator

java.lang.Object
  extended by de.uplanet.lucy.server.businesslogic.util.UniqueNumberGenerator

@Scriptable
public final class UniqueNumberGenerator
extends java.lang.Object

Generates a unique id number.

Version:
$Revision: 86610 $

Constructor Summary
UniqueNumberGenerator()
           
 
Method Summary
static int get(de.uplanet.jdbc.JdbcConnection p_conn, FieldInfo p_fieldInfo)
           
static int getCurrentNumber(FieldInfo p_fieldInfo)
           
static void reset(java.lang.String p_strGuid)
          reset number generation for passed field guid
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniqueNumberGenerator

public UniqueNumberGenerator()
Method Detail

get

public static int get(de.uplanet.jdbc.JdbcConnection p_conn,
                      FieldInfo p_fieldInfo)
               throws de.uplanet.jdbc.sqlhelper.SqlHelperException,
                      java.sql.SQLException
Parameters:
p_conn - database connection used to retrieve an initial number value
p_fieldInfo - The data field that should be incremented.
Returns:
a unique number for the guid
Throws:
de.uplanet.jdbc.sqlhelper.SqlHelperException
java.sql.SQLException

getCurrentNumber

public static int getCurrentNumber(FieldInfo p_fieldInfo)
                            throws de.uplanet.jdbc.sqlhelper.SqlHelperException,
                                   java.sql.SQLException
Parameters:
p_fieldInfo - The data field that should be incremented.
Returns:
get the next unique number without generating a new one. (Twice calls will get the same number)
Throws:
de.uplanet.jdbc.sqlhelper.SqlHelperException
java.sql.SQLException

reset

public static void reset(java.lang.String p_strGuid)
reset number generation for passed field guid



Last updated: 2012-07-06 09-36
Copyright © 2000-2012 United Planet. All Rights Reserved.