| java.lang.Object com.jcorporate.expresso.core.dbobj.NextNumber com.jcorporate.expresso.core.dbobj.NextNumberImpl
NextNumberImpl | public class NextNumberImpl extends NextNumber (Code) | | this class is a SOLITAIRE, used in NextNumber
author: Original by Michael Nash, rewritten by Michael Rimov, Larry Hamel author: author: Modify by Yves Henri AMAIZO See Also: com.jcorporate.expresso.core.dbobj.NextNumber See Also: NextNumber - Manages in-memory, database independent autoincrement values. This See Also: version is not cluster safe. See Expresso Enterprise for a cluster-safe version. since: $DatabaseSchema $Date: 2004/11/17 20:48:11 $ |
Field Summary | |
protected volatile ConcurrentReaderHashMap | contextMap Top level hashMap - This level separates the db contexts. |
Constructor Summary | |
public | NextNumberImpl() Create the base level hashes for each db key. |
contextMap | protected volatile ConcurrentReaderHashMap contextMap(Code) | | Top level hashMap - This level separates the db contexts. The object
returned by a get() is another Map() containing lists of dbobject
fields. The key is DBObject.getTargetTable() + "." + DBField.getFieldName()
this will return the Integer object that will be the number is internally
incremented,
|
NextNumberImpl | public NextNumberImpl()(Code) | | Create the base level hashes for each db key.
|
checkParams | protected void checkParams(String db, DBObject callingObject, String fieldName) throws DBException(Code) | | All parameters are
fully checked to avoid potential NullPointerExceptions
Parameters: db - The context to get this out of. Parameters: callingObject - - the DBObject that this nextnumber object belongs to. Parameters: fieldName - - the field name within the callingObject that this nextnumber belongs to. |
initialize | public void initialize(String db, DBObject callingObject) throws DBException(Code) | | Initializes hash entries for all auto-inc fields in a particular DBOBject. This is
called the first time that a particular DBObject has a nextnumber called for any field.
this method should be synchronized externally.
Parameters: db - The db to hook this nextnumber object to. Parameters: callingObject - the object to initialize from. |
reset | public void reset(String db)(Code) | | Reset the counts for the paritcular db each subsequent operation will
require a new getMax(). There is questionable threadsafety about the
reset methods. Please only do it on a "non-live" server. Used after a
DBCreate or DeleteSchema has been called.
|
reset | public void reset(String db, DBObject callingObject)(Code) | | Clears the table on a particular dbobject. Similar to reset db
Parameters: db - The db context that the next number resides in. Parameters: callingObject - the object that links to the various nextnumberobjects |
|
|