getNextInteger(java.lang.String collectionName)
Gets the next key for the given collection.
static void
resetAutoNumber(java.lang.String collectionName)
Resets the given autonumber to zero.
static void
setAutoNumber(java.lang.String collectionName,
java.lang.Integer value)
Sets the given autonumber to the given value so that it starts
counting at the given value.
public static java.lang.Integer getNextInteger(java.lang.String collectionName)
throws java.lang.ArrayIndexOutOfBoundsException
Gets the next key for the given collection.
Note 1: you must deploy EJB AutoNumber
Note 2: the keys are persistent in your database, independent of
the actual table
Note 3: you can only add instances to the collection which have a
key generated by this method, otherwise the keys are not guaranteed
to be unique
Note 4: key values are >= 0
Parameters:
collectionName - the name of the collection for which you want an autonumber
Throws:
java.lang.ArrayIndexOutOfBoundsException - if no more numbers are available
resetAutoNumber
public static void resetAutoNumber(java.lang.String collectionName)
Resets the given autonumber to zero.
Use with extreme care!
setAutoNumber
public static void setAutoNumber(java.lang.String collectionName,
java.lang.Integer value)
Sets the given autonumber to the given value so that it starts
counting at the given value.
Use with extreme care!