|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--apollo.Storable.Storable
The superclass for Storable objects. Copyright Joe Kislo, All Rights Reserved.
Field Summary | |
static int |
AVERAGE
|
static int |
COUNT
|
static int |
CUSTOM
|
static java.lang.Boolean |
False
|
static java.lang.Object[][] |
fieldIndex
|
java.lang.String[] |
fieldNames
|
java.lang.String[] |
fieldPrimaryKey
|
java.lang.Object[][] |
fieldType
|
static int |
MAX
|
static int |
MIN
|
static java.lang.Integer |
NON_UNIQUE
|
static int |
SUM
|
static java.lang.Boolean |
True
|
static java.lang.Integer |
UNIQUE
|
Constructor Summary | |
Storable(java.lang.Object[][] fieldType,
java.lang.String[] fieldPrimaryKey)
You must pass up to the constructor four fields. |
Method Summary | |
static void |
addValueAtomic(ManagerTracker MT,
java.lang.Class CLOperateTable,
java.lang.String strOperateAttribute,
int value,
WhereStatement whereStatement)
|
static void |
begin(TransactionTracker TT,
java.lang.Class theClass)
|
static void |
commit(TransactionTracker TT,
java.lang.Class theClass)
|
boolean |
equals(java.lang.Object o)
|
java.lang.String[] |
getFieldNames()
This will return the fieldNames array. |
java.lang.String[] |
getFieldPrimaryKey()
This will return the primary key of the storable object. |
abstract java.lang.Object[] |
getFieldValues()
This must return the data the object is having stored. |
int |
getIndexForField(java.lang.String theFieldName)
Will return the index of theFieldName in fieldNames. |
java.lang.Object[] |
getPrimaryKeyValues()
This method will retrieve the PrimaryKeyValues and return them in an array |
java.util.Vector |
getPrimaryKeyValuesVector()
This method will retrieve the PrimaryKeyValues and return them in a vector (which can be stored and keyed off in a Hashtable, unlike an array) |
void |
insert(ManagerTracker MT)
This will insert this record into the SQL table. |
static java.lang.Object[] |
loadArrayInstance(ManagerTracker MT,
java.lang.Class theClass,
WhereStatement whereStatement)
|
static java.lang.Object[] |
loadArrayInstance(ManagerTracker MT,
java.lang.Class theClass,
WhereStatement whereStatement,
java.lang.String[] includeFields)
This loads an array of instances of the storable subclass matching the SQLWhereClause. |
static java.lang.Object |
loadFunction(ManagerTracker MT,
StorableFunction function,
java.lang.Class[] CLGroupBy,
java.lang.String[] attributeGroupBy,
WhereStatement whereStatement)
|
static java.lang.Object |
loadFunction(ManagerTracker MT,
StorableFunction function,
WhereStatement whereStatement)
|
static java.lang.Object |
loadInstance(ManagerTracker MT,
java.lang.Class theClass,
java.lang.Object[] theLoadKey)
This loads a single instance of the storable subclass using theLoadKey as the primary key. |
static java.util.Vector |
loadVectorInstance(ManagerTracker MT,
java.lang.Class theClass,
WhereStatement whereStatement)
|
static java.util.Vector |
loadVectorInstance(ManagerTracker MT,
java.lang.Class theClass,
WhereStatement whereStatement,
java.lang.String[] includeFields)
This loads a vector (or a set) of objects out of the database as described by the WhereStatement. |
void |
remove(ManagerTracker MT)
This will remove this record from the SQL table. |
static void |
rollback(TransactionTracker TT,
java.lang.Class theClass)
|
protected void |
setAutoIncrement(long i)
|
void |
setUpdatedField(java.lang.String theFieldName)
When you update a field in a storable, you should tell the Storable superclass that you updated that field. |
static java.lang.String |
SQLSanitize(ManagerTracker MT,
java.lang.Class theClass,
java.lang.String strToSanitize,
boolean includeQuotes)
|
void |
synchronize(ManagerTracker MT)
Synchronize will confirm that this instance of the Storable object is the newest one by checking the internal version number. |
static boolean |
tableCreated(ManagerTracker MT,
java.lang.Class theClass)
|
void |
testStorableConfiguration(java.lang.Object storableSubclass)
|
java.lang.String |
toString()
This will return a string representation of the Storable object |
void |
update(ManagerTracker MT)
This will update the record in the SQL table. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int SUM
public static final int AVERAGE
public static final int COUNT
public static final int MAX
public static final int MIN
public static final int CUSTOM
public static final java.lang.Integer UNIQUE
public static final java.lang.Integer NON_UNIQUE
public static final java.lang.Object[][] fieldIndex
public static final java.lang.Boolean True
public static final java.lang.Boolean False
public final java.lang.Object[][] fieldType
public final java.lang.String[] fieldNames
public final java.lang.String[] fieldPrimaryKey
Constructor Detail |
public Storable(java.lang.Object[][] fieldType, java.lang.String[] fieldPrimaryKey)
fieldNames
- Holds the SQL table column names.fieldTypes
- Holds the SQL table column types.fieldClasses
- Holds the Class objects corrisponding to each attributefieldCanBeNull
- Holds boolean values weather the respective column can be null.fieldPrimaryKey
- Holds the SQL column names of the fields comprimsing the primary (and unique) key.Method Detail |
public void testStorableConfiguration(java.lang.Object storableSubclass) throws MalformedStorable
public java.lang.String[] getFieldNames()
public java.lang.String[] getFieldPrimaryKey()
public void setUpdatedField(java.lang.String theFieldName) throws MalformedStorable
theFieldName
- The field you just modifiedpublic int getIndexForField(java.lang.String theFieldName) throws MalformedStorable
public abstract java.lang.Object[] getFieldValues()
public java.lang.Object[] getPrimaryKeyValues()
public java.util.Vector getPrimaryKeyValuesVector()
public static java.lang.Object loadInstance(ManagerTracker MT, java.lang.Class theClass, java.lang.Object[] theLoadKey) throws MalformedStorable
theClassName
- The Storable subtype Class objecttheLoadKey
- The Key to use for load (primary key only)public static java.lang.Object[] loadArrayInstance(ManagerTracker MT, java.lang.Class theClass, WhereStatement whereStatement, java.lang.String[] includeFields)
theClassName
- The Storable subtype Class objectwhereStatement
- The WhereQuery describing the rows to returnincludeFields
- If this variable is supplied only the fields in this array will be retrieved and sent to the object constructorpublic static java.lang.Object[] loadArrayInstance(ManagerTracker MT, java.lang.Class theClass, WhereStatement whereStatement)
public static void begin(TransactionTracker TT, java.lang.Class theClass)
public static void commit(TransactionTracker TT, java.lang.Class theClass)
public static void rollback(TransactionTracker TT, java.lang.Class theClass)
protected void setAutoIncrement(long i)
public static java.lang.String SQLSanitize(ManagerTracker MT, java.lang.Class theClass, java.lang.String strToSanitize, boolean includeQuotes)
public static java.lang.Object loadFunction(ManagerTracker MT, StorableFunction function, WhereStatement whereStatement)
public static java.lang.Object loadFunction(ManagerTracker MT, StorableFunction function, java.lang.Class[] CLGroupBy, java.lang.String[] attributeGroupBy, WhereStatement whereStatement)
public static void addValueAtomic(ManagerTracker MT, java.lang.Class CLOperateTable, java.lang.String strOperateAttribute, int value, WhereStatement whereStatement)
public static java.util.Vector loadVectorInstance(ManagerTracker MT, java.lang.Class theClass, WhereStatement whereStatement)
public static java.util.Vector loadVectorInstance(ManagerTracker MT, java.lang.Class theClass, WhereStatement whereStatement, java.lang.String[] includeFields)
MT
- The ManagerTrackertheClass
- The storable class to loadwhereStatement
- The wherequery describing the objects to loadincludeFields
- If this variable is supplied only the fields in this array will be retrieved and sent to the object constructorpublic static boolean tableCreated(ManagerTracker MT, java.lang.Class theClass)
public java.lang.String toString()
toString
in class java.lang.Object
public void insert(ManagerTracker MT)
public void remove(ManagerTracker MT)
public void update(ManagerTracker MT)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void synchronize(ManagerTracker MT)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |