Expresso 5-6

com.jcorporate.expresso.core.dbobj
Class AutoDBObject

java.lang.Object
  extended bycom.jcorporate.expresso.core.dataobjects.BaseDataObject
      extended bycom.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
          extended bycom.jcorporate.expresso.core.dbobj.DBObject
              extended bycom.jcorporate.expresso.core.dbobj.SecuredDBObject
                  extended bycom.jcorporate.expresso.core.dbobj.AutoDBObject
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, LookupInterface, Securable, Serializable

public class AutoDBObject
extends SecuredDBObject

This class provides convenience methods by querying the database table it is set to and automatically setting up it's own fields that way. Creation date: (10/3/00 11:07:02 AM)

Author:
Michael Nash
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.jcorporate.expresso.core.dbobj.DBObject
DBObject.FieldError, DBObject.FieldUpdate
 
Field Summary
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
ADD, ALL_FUNCTIONS, CACHE_NAME, CACHE_TTY, DELETE, SEARCH, SYSTEM_ACCOUNT, SYSTEM_ACCOUNT_NAME, UPDATE
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.DBObject
ATTRIBUTE_ERROR, ATTRIBUTE_ERROR_MESSAGE, ATTRIBUTE_PAGE_LIMIT, BIG_DECIMAL_ZERO, EMAIL_MASK, EVENT_ADD, EVENT_DELETE, EVENT_UPDATE, FLOAT_MASK, INT_MASK, IS_CHECK_RELATIONAL_INTEGRITY, UPDATE_CHANGED_ONLY, WHERE_KEYWORD
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
anyFieldsDistinct, anyFieldsToRetrieve, appendCustomWhere, caseSensitiveQuery, customWhereClause, dbKey, distinctFields, localConnection, LONGBINARY_READ_DEFAULT_SIZE, maxRecords, myClassName, myUpdates, offsetRecord, recordSet, retrieveFields, sMetadataMap, sortKeys
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
currentStatus, globalMask
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.DataObject
STATUS_CURRENT, STATUS_DELETED, STATUS_NEW, STATUS_UPDATED
 
Constructor Summary
AutoDBObject()
          AutoDBObject constructor comment.
AutoDBObject(DBConnection newConnection)
          AutoDBObject constructor comment.
AutoDBObject(int uid)
          Initialize an AutoDBObject with a uid.
 
Method Summary
 String getDefinitionName()
          Retrieve the key to the definition name for the given DBObject.
 DBObject getThisDBObj()
          getThisDBObj method comment.
 void setDefinitionName(String definitionName)
          Use this method to set the key to the definition name for the Defineable database object.
 void setTargetTable(String theTable)
          Set the target table for this AutoDBObject - this causes the object to set itself up with the fields from the database as it's fields.
protected  void setupFields()
          setupFields method.
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
add, canRequesterAdd, canRequesterDelete, canRequesterRead, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, delete, deleteAll, find, getRequestingUid, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, isAllowed, retrieve, search, searchAndRetrieveList, searchAndRetrieveList, setRequestingUid, update
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.DBObject
addDetail, addField, addField, addFieldError, addFoundKeys, addIfNeeded, addIndex, addKey, addOrUpdate, addSortKey, addTransition, addVirtualField, addVirtualField, addVirtualField, addVirtualField, average, basicAdd, cacheIsChangedComparison, checkAllReferredToBy, checkAllRefs, checkAllRefsPublic, checkDeleteDetailPerm, checkField, checkRef, checkRef, clear, clearDistinctFields, clearError, clearFieldsToRetrieve, clearSortKeys, containsWildCards, delete, deleteAll, deleteDetails, denotesRange, equals, forKey, formatDateTime, get, getAllAttributes, getAttribute, getAttributesIterator, getBooleanFieldValue, getCacheSize, getCacheStatsMap, getCacheUtil, getCheckZeroUpdate, getCustomWhereClause, getDataContext, getDataField, getDataTransferObject, getDBName, getDetails, getDistinctFieldCount, getDistinctFields, getField, getFieldBigDecimal, getFieldBoolean, getFieldByte, getFieldByteArray, getFieldData, getFieldDate, getFieldDecimalFormatted, getFieldDouble, getFieldErrorMessage, getFieldFloat, getFieldInt, getFieldLong, getFieldMetaData, getFieldShort, getFieldsToRetrieveCount, getFilterClass, getFoundCount, getFoundKeysArray, getIndexArray, getISOValuesDefault, getISOValuesDefault, getISOValuesDefault, getKey, getKeyFieldListIterator, getLength, getLengthInt, getLocalConnection, getLocale, getLogger, getLookupObject, getMax, getMax, getMaxRecords, getMyKeys, getMyUpdatesArray, getOffsetRecord, getPatternMatcher, getPrecision, getSerializedForm, getStringFilter, getThisDBbj, getValidValueDescrip, getValidValues, getValidValuesList, getValues, getValuesDefault, getValuesDefault, getValuesDefault, hasError, hasErrors, haveAllKeys, initialize, isCached, isChanged, isDistinct, isEmpty, isFieldDistinct, isFieldNull, isFieldsToRetrieve, isFieldToRetrieve, isMultiValued, isReadOnly, isSecret, isVirtual, loadFromConnection, logChange, max, min, newInstance, noNewLine, noQuotes, notifyListeners, populateDefaultValues, referredToBy, removeAttribute, removeFromCache, retrieveFromCache, saveBinaryField, search, set, setAttribute, setCacheSize, setCharset, setCheckZeroUpdate, setConnection, setConnection, setCustomWhereClause, setCustomWhereClause, setDataContext, setDataField, setDataTransferObject, setDefaultValue, setDescription, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setFieldData, setFieldData, setFieldDistinct, setFieldsToRetrieve, setFilterClass, setFilterClass, setKeys, setLocale, setLookupField, setLookupObject, setMask, setMaxRecords, setMultiValued, setName, setOffsetRecord, setReadOnly, setSchema, setSecret, setSortKey, setStringFilter, setStringFiltersOnAll, setTargetDbSchema, sqlAggrFunction, sum, toDebugString, update, updateAll, updateAll, verify
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
addInParam, addOutParam, buildWhereClause, buildWhereClauseBuffer, checkZeroUpdate, constructNewMetaData, createAndExecuteSearch, createAndRunStoreProcedure, getConnectionPool, getCustomStringFieldValue, getDef, getDistinctFieldArrayList, getExecutor, getFieldsToRetrieveIterator, getJDBCMetaData, getJDBCUtil, getMappedDataContext, getMetaData, getQueryInterface, getSerialForm, loadFromConnection, makeLimitationStub, quoteIfNeeded, runStoredProcedure, runStoredProcedureAndRetrieveList, selectFieldString, setCaseSensitiveQuery, setDBConnectionPool, setDBName, setMappedDataContext, setOriginalDBName, setTargetStoreProcedure
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
getGlobalMask, getStatus, isGlobalMasked, setFieldsWithDefaults, setGlobalMask, setStatus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoDBObject

public AutoDBObject()
             throws DBException
AutoDBObject constructor comment.

Throws:
DBException - The exception description.

AutoDBObject

public AutoDBObject(DBConnection newConnection)
             throws DBException
AutoDBObject constructor comment.

Parameters:
newConnection - com.jcorporate.expresso.core.db.DBConnection
Throws:
DBException - The exception description.

AutoDBObject

public AutoDBObject(int uid)
             throws DBException
Initialize an AutoDBObject with a uid.

Parameters:
uid - the user ID or -1 if System privileges
Throws:
DBException - upon error
Method Detail

getThisDBObj

public DBObject getThisDBObj()
                      throws DBException
getThisDBObj method comment.

Overrides:
getThisDBObj in class DBObject
Returns:
a fully instantiated DBObject
Throws:
DBException - upon error.
See Also:
DBObject.getThisDBObj()

setTargetTable

public void setTargetTable(String theTable)
                    throws DBException
Set the target table for this AutoDBObject - this causes the object to set itself up with the fields from the database as it's fields. All existing fields are cleared.

Overrides:
setTargetTable in class DBObject
Parameters:
theTable - Table for this object
Throws:
DBException - upon error.

setDefinitionName

public void setDefinitionName(String definitionName)
                       throws DataException
Use this method to set the key to the definition name for the Defineable database object. The actual meaning of the definitionName may be different. For example, AutoDBObject's definition name is the database table name. JoinedDataObject's definition name is the classpath URL location to the definition XML file.

Parameters:
definitionName - java.lang.String, the actual definition of the dataobject.
Throws:
DataException - if the DataObject is unable to initialize itself with the given definition name.

getDefinitionName

public String getDefinitionName()
Retrieve the key to the definition name for the given DBObject.

Returns:
the definition name.

setupFields

protected void setupFields()
                    throws DBException
setupFields method. avoids superclass usage with test at top of method. called for real as a side-effect of setTargetTable()

Overrides:
setupFields in class DBObject
Throws:
DBException - If there is an error setting up the fields as requested. For example, if a field allowing null is requested as part of the key

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.