|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.dbobj.NextNumber
Base class for pluggable next number autoincrementing system.
for more information| Field Summary | |
protected static boolean |
CHECK_PARAMETERS
Set this to false and recompile to cause NextNumber to not check it's input parameters. |
static String |
DEFAULT_CLASS_HANDLER
|
protected static org.apache.log4j.Logger |
log
The lo4j log category. |
protected static NextNumber |
theInstance
The actual static instance of the Next Number implementation |
| Constructor Summary | |
protected |
NextNumber()
Constructor - Do not call directly. |
| Method Summary | |
static void |
destroy()
Fill in for potential resource removal Should be called by ConfigInit. |
static NextNumber |
getInstance()
Factory Method returns a constructed instance of the NextNumber Manager. |
protected String |
getKey(DBObject callingDBObject,
String fieldName)
Builds the key string for lookup within the dbobject hashmap. |
protected long |
getMax(String db,
DBObject callingObject,
String oneField)
Gets the maximum value for a particular object and field Used if there's no value loaded in memory or state. |
abstract long |
getNext(String db,
DBObject callingDBObject,
String fieldName)
Get the nextnumber for this dbobject. |
abstract void |
registerField(String db,
DBObject callingDBObject,
String fieldName)
Register a field for next number information. |
abstract void |
reset(String db)
Reset the counts for the paritcular db each subsequent operation will require a new getMax(). |
abstract void |
reset(String db,
DBObject callingObject)
Clears the table on a particular dbobject. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String DEFAULT_CLASS_HANDLER
protected static final boolean CHECK_PARAMETERS
protected static org.apache.log4j.Logger log
protected static NextNumber theInstance
| Constructor Detail |
protected NextNumber()
| Method Detail |
public static NextNumber getInstance()
throws DBException
DBException
protected long getMax(String db,
DBObject callingObject,
String oneField)
throws DBException
db - The dataContext to get forcallingObject - the calling DBObjectoneField - the field name to query
DBException
public abstract void registerField(String db,
DBObject callingDBObject,
String fieldName)
throws DBException
db - The database context to work with.callingDBObject - The calling database object to register the field forfieldName - The field name to register into the NextNumber engine
DBException
public abstract long getNext(String db,
DBObject callingDBObject,
String fieldName)
throws DBException
db - The datacontext. MAKE SURE THIS IS CORRECT or else you will get duplicate running counts for each incorrect DB name, and thus Duplicate key errors when trying to write rows.callingDBObject - The calling DBOBjectfieldName - the name of the field to get the next number value for
DBExceptionpublic abstract void reset(String db)
db - the db context to clear all the next number values for.
public abstract void reset(String db,
DBObject callingObject)
db - The db context that the next number resides in.callingObject - the object that links to the various nextnumber
objectspublic static void destroy()
Fill in for potential resource removal Should be called by ConfigInit. destroy() Or by unit tests to reset everything to a pristine state.
Note: Do not call getInstance() to call destroy. Simply use NextNumber.destroy();
protected String getKey(DBObject callingDBObject,
String fieldName)
throws DBException
callingDBObject - the calling DBObjectfieldName - the fieldName to get the key for
DBException - upon error
Modify by Yves Henri AMAIZO
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||