|
Transfer version 1.1 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
transfer.com.sql.IDGenerator
public class IDGenerator
Generates IDs for a sequence
| Constructor Summary | |
|---|---|
init(numeric changeFactor, Datasource datasource, XMLFileReader configReader, Utility utility)
Constructor |
|
| Method Summary | |
|---|---|
private boolean |
checkHaveSequence(string name)
Checks to see if the sequence is in the collection |
private void |
createNewSequence(Object object)
Creates a new sequence in the database if it doesn't exist |
private void |
createSequenceTable()
Creates the database table for you |
private numeric |
getChangeFactor()
|
private numeric |
getCurrentIDFromSequence(string name)
gets the Current ID from the sequence |
private Datasource |
getDatasource()
|
string |
getGUID()
Returns a MS GUID, that is performant for indexing as per http://www.informit.com/articles/article.asp?p=25862 |
private numeric |
getIDFromSequence(Object object)
Gets an ID from a given sequence |
private numeric |
getMaxIDFromSequence(string name)
gets the max ID from the sequence |
numeric |
getNumericID(Object object)
Gets an numeric ID for a given object (synchronized) |
private struct |
getSequenceCollection()
|
uuid |
getUUID()
Gets a UUID as an ID |
private Utility |
getUtility()
|
private void |
increaseMaxIDForSequence(string name)
Increases the MaxID for a sequence |
private numeric |
incrementCurrentID(string name)
retruns the currentID + 1 and increments it |
private void |
initSequenceTable(XMLFileReader configReader)
creates the sequence table, if it is needed |
private void |
restoreSequence(Object object)
restores a sequence from the DB |
private numeric |
retrieveSequence(Object object, [boolean runOnce='false'], [boolean useBinding='true'])
Retrives the current ID for the sequence |
private void |
setChangeFactor(numeric ChangeFactor)
|
private void |
setCurrentIDFromSequence(string name, numeric currentID)
Sets the Max ID for a sequence |
private void |
setDatasource(Datasource Datasource)
|
private void |
setMaxIDFromSequence(string name, numeric maxID)
Sets the Max ID for a sequence |
private void |
setSequenceCollection(struct SequenceCollection)
|
private void |
setUtility(Utility Utility)
|
private any |
throw(string type, string message, [string detail=''])
Throws an Exception |
private void |
updateSequence(string name, numeric maxID)
Updates the sequence in the db |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init(numeric changeFactor, Datasource datasource, XMLFileReader configReader, Utility utility)
changeFactor - How many IDs to keep residentdatasource - Datasource for the applicaitonconfigReader - The XML Reader for the config fileutility - The utility class| Method Detail |
|---|
private boolean checkHaveSequence(string name)
name - The name of the tableprivate void createNewSequence(Object object)
object - The type of object to get the ID forprivate void createSequenceTable()
private numeric getChangeFactor()
private numeric getCurrentIDFromSequence(string name)
name - The name of the tableprivate Datasource getDatasource()
public string getGUID()
private numeric getIDFromSequence(Object object)
object - The type of object to get the ID forprivate numeric getMaxIDFromSequence(string name)
name - The name of the tablepublic numeric getNumericID(Object object)
object - The type of object to get the ID forprivate struct getSequenceCollection()
public uuid getUUID()
private Utility getUtility()
private void increaseMaxIDForSequence(string name)
name - The name of the tableprivate numeric incrementCurrentID(string name)
name - The name of the tableprivate void initSequenceTable(XMLFileReader configReader)
configReader - The XML Reader for the config fileprivate void restoreSequence(Object object)
object - The type of object to get the ID forprivate numeric retrieveSequence(Object object, [boolean runOnce='false'], [boolean useBinding='true'])
object - The type of object to get the ID forrunOnce - Flag to see if this has been run recursively or not yet, to prevent infinite loopuseBinding - use the param bindprivate void setChangeFactor(numeric ChangeFactor)
ChangeFactorprivate void setCurrentIDFromSequence(string name, numeric currentID)
name - The name of the tablecurrentID - The new currentIDprivate void setDatasource(Datasource Datasource)
Datasourceprivate void setMaxIDFromSequence(string name, numeric maxID)
name - The name of the tablemaxID - The new maxIDprivate void setSequenceCollection(struct SequenceCollection)
SequenceCollectionprivate void setUtility(Utility Utility)
Utilityprivate any throw(string type, string message, [string detail=''])
type - The type of exceptionmessage - The message to accompany the exceptiondetail - The detail message for the exceptionprivate void updateSequence(string name, numeric maxID)
name - The name of the tablemaxID - The new maxID
|
Transfer version 1.1 | ||||
| FRAMES | |||||