Expresso 5-6

com.jcorporate.expresso.core.dbobj
Class DBObjectDef

java.lang.Object
  extended bycom.jcorporate.expresso.core.dbobj.DBObjectDef
All Implemented Interfaces:
DataObjectMetaData, JDBCObjectMetaData, Serializable

public class DBObjectDef
extends Object
implements JDBCObjectMetaData

This object contains the "definition" of the DBObject, while the DBObject itself contains only the data itself. One DBObjectDef object is stored in a static HashMap in the DBObject class, and is looked up and referenced for all definitions of the structure of the given object.

since this class is not threadsafe for adding information, it is imperitive that all information addition, typically done when the first instance of a DBObject is instantiated, is done in a synchronized context.

Author:
Michael Nash
See Also:
Serialized Form

Constructor Summary
DBObjectDef()
          Default Constructor.
 
Method Summary
 void addDetail(String objName, String keyFieldsLocal, String keyFieldsForeign)
          Specify a new "detail" db object, and the fields in this object they specify the fields in the related object
 void addField(String fieldName, String fieldType, int fieldSize, boolean allowNull, String fieldDescription)
          Add a field with more details: This version of addfield supplies the allowNull flags and a description of the field to be used when reporting errors to the user.
 void addField(String fieldName, String fieldType, int fieldSize, boolean allowNull, String descriptionKey, String fieldDescription)
          Add a field with more details: This version of addfield supplies the allowNull flags and a description of the field to be used when reporting errors to the user.
 void addField(String fieldName, String fieldType, int fieldSize, int fieldPrecision, boolean allowNull, String fieldDescription)
          Add a field with more details: This version allows the user to specify a precision, for fields that use both a size and precision.
 void addIndex(String indexName, String fieldNames, boolean isUnique)
          Add an index to the table.
 void addInParam(String inFieldName)
          Add a new field to the list of fields that are part of this object's list of input parameters.
 void addKey(String keyFieldName)
          Add a new field to the list of fields that are part of this object's key.
 void addOutParam(String outFieldName)
          Add a new field to the list of fields that are part of this object's list of output parameter.
 void addTransition(Transition t)
          ??????
 void addVirtualField(String fieldName, String fieldType, int fieldSize, int fieldPrecision, boolean allowNull, String fieldDescription)
          Add a field with more details: This version allows the user to specify a precision, for fields that use both a size and precision.
 void addVirtualField(String fieldName, String fieldType, int fieldSize, int fieldPrecision, boolean allowNull, String descriptionKey, String fieldDescription)
          Add a field with more details: This version allows the user to specify a precision, for fields that use both a size and precision.
 void addVirtualField(String fieldName, String fieldType, int fieldSize, String fieldDescription)
          Add a new virtual field to the definition of this object.
 void addVirtualField(String fieldName, String fieldType, int fieldSize, String descriptionKey, String fieldDescription)
          Add a new virtual field to the definition of this object.
 boolean allowsNull(String fieldName)
          Returns whether the field allows null values or not.
 boolean checkZeroUpdate()
          Retrieves whether or not checkZeroUpdate is enabled for this data object
 void disableLogging()
          Disable change logging of this object
 void enableLogging()
          Enable logging of changes to this object.
 Set getAllAttributes(String fieldName)
          Retrieve all the attributes so you can iterate through them.
 HashMap getAllDBFields()
           
 Hashtable getAllFields()
          Deprecated. use getAllFieldsMap instead
 Iterator getAllFieldsIterator()
          Way to get an interator into the allFields objects
 HashMap getAllFieldsMap()
          Return the "allFields" Hashtable, which contains all of the DBField objects that make up this DB object.
 Hashtable getAllKeys()
          Deprecated. Use getAllKeysMap or getAllKeysIterator instead
 Iterator getAllKeysIterator()
           Non-threadsafe way to get an interator into the allKeys data structure
 HashMap getAllKeysMap()
          Return the "allKeys" hash, containing the DBField objects that make up the primary key for this db object.
 Object getAttribute(String fieldName, String attribName)
          Gets an Object attribute from the field's metatdata
 Iterator getAttributesIterator(String fieldName)
           
 int getCacheSize()
          Get the current Cache size of this object.
 String getCharset()
          return the current object's character set
 DBField getDBField(String fieldName)
          Get the DBField object specified by the fieldname
 String getDefaultValue(String fieldName)
          Retreive the default value of a particular field for when it is first instantiated
 String getDescription()
          Return a description of this database object.
 String getDescription(Locale l)
          Retrieve the table description in a localized way.
 String getDescription(Locale l, String fieldName)
          Retrieve an i18n'ized description as per the locale defined for the 'client'
 String getDescription(String fieldName)
          Return the long description of a field, if available
 String getDetailFieldsForeign(String detailName)
          Retrieve the foreign key fields
 String getDetailFieldsLocal(String detailName)
          Retrieve the local key fields.
 Enumeration getDetails()
           
 Set getDetailSet()
          Retrieve a set of detail objects.
 Enumeration getFieldList()
          Deprecated. Use getFieldListArray or getFieldListIterator instead
 ArrayList getFieldListArray()
          Get a list of all of the fields in this object This is threadsafe in that it makes a new copy of the fieldNamesInOrder ArrayList
 Iterator getFieldListIterator()
          Get a list of all of the fields in this object This iterator is not thread safe.
 DataFieldMetaData getFieldMetadata(String fieldName)
          Retrieve the metadata for the field.
 String[] getFields()
          This convenience method iterates through all the fields belonging to this DBObject returns an array of field names ( String ).
 FilterManager getFilterManager()
           
 Object[] getIndexArray()
          Get an array of DBIndex objects for purpose of creating them through the schema.
 Iterator getInParamFieldListIterator()
          Retrieve an interator of IN param fields
 ArrayList getInParamListArray()
          Get a list of all of the names of the IN param fields in this object
 Enumeration getKeyFieldList()
          Deprecated. Use getKeyFieldArray instead
 ArrayList getKeyFieldListArray()
          Get a list of all of the names of the key fields in this object
 Iterator getKeyFieldListIterator()
          Retrieve an interator of key fields
 String getLength(String fieldName)
          Return the length of a field
 int getLengthInt(String fieldName)
          Return the length of a field as an integer
 String getLookupField(String fieldName)
          When you get a lookup object, to perform a complete mapping between the two, you need to know what field name in the remote object maps to this field.
 String getLookupObject(String fieldName)
          Get a field's lookup object - this is the name of another database object that can be used to look up valid values for this object.
 String getName()
          Get the name of this object
 Iterator getOutParamFieldListIterator()
          Retrieve an interator of IN param fields
 int getOutParamFieldsCount()
          This convenience method counts DBFields belonging to this DBObject that are set to retrieve.
 ArrayList getOutParamListArray()
          Get a list of all of the names of the OUT param fields in this object
 int getPrecision(String fieldName)
          Retrieve the precision of a particular field
 String getSchema()
          Retrieve the schema object's class name associated with this data object
 String getTargetDbCatalog()
          Return the Schema Name of the current database object.
 String getTargetDbSchema()
          Return the Schema Name of the current database object.
 String getTargetSQLTable(String dataContext)
          Return the Table Name of the current database object.
 String getTargetStoreProcedure()
          Return the Store procedure Name of the current database object.
 String getTargetTable()
          Return the Table Name of the current database object.
 Iterator getTransitionsIterator()
          ????????????
 String getType(String fieldName)
          Return the type of a field - this method returns the internal Expresso type
 boolean hasField(String fieldName)
          This method will return a boolean true if the field is defined in the DBOBject, false otherwise.
 boolean hasIndex()
          Returns true if an Index exists for this array.
 boolean isAllowsNull(String fieldName)
          Returns whether the field allows null values or not.
 boolean isField(String fieldName)
          Check if a certain name is a field (of any kind) in this DBOBject
 String isFieldIgnoreCase(String fieldName)
          Check if a certain name is a field (of any kind) in this DBOBject since SQL is case insensitive, ignore case of field name for match, this method takes longer, so use isField if the field name is known precisely
 boolean isInField(String fieldName)
          Check if a certain name is a OUTPUT field parameter(of any kind) in this DBOBject
 boolean isLoggingEnabled()
          Retrieves whether or not change logging is enabled for a particular data object
 boolean isMultiValued(String fieldName)
          Method called to determine if a particular field is multi-valued, that is does it have a set of specific values and descriptions
 boolean isOutField(String fieldName)
          Check if a certain name is a INPUT field parameter(of any kind) in this DBOBject
 boolean isReadOnly(String fieldName)
          Is a given field readOnly - these fields are not offered for entry when a form is produced by the generic database maintenance servlet
 boolean isReturningValue()
           
 boolean isSecret(String fieldName)
          Is a given field 'secret' - these fields are not shown when a list is produced by the generic database maintenance servlet (DBMaint).
 boolean isVirtual(String fieldName)
          Is a given field virtual?
 void removeAttribute(String fieldName, String attribName)
          Removes an attribute from the field.
 void setAttribute(String fieldName, String attribName, Object attribValue)
           
 void setCacheSize(int newValue)
          Sets the cache size for this DBObject
 void setCharset(String newCharSet)
          Set a characterset for a particular field.
 void setCheckZeroUpdate(boolean newFlag)
          Turn on or off the facility to verify that when an update is made that at least one record got updated.
 void setDefaultValue(String fieldName, String fieldValue)
          Sets the default value for a particular field
 void setDescription(String newDescription)
          Set the description of this object
 void setLookupObject(String fieldName, String objectName)
          Set a field's lookup object - this is the name of another database object that can be used to look up valid values for this object.
 void setMask(String fieldName, String newMask)
          Sets the field's regular expression validation mask.
 void setMultiValued(String fieldName)
          Set this field to be multi-valued - e.g. there is a specific list of values that are valid for this field.
 void setName(String theName)
          Set the name of this object - this name is used to identify the db object with a more human-readable description
 void setReadOnly(String fieldName)
          Set a field as read-only - these fields are not offered for update when a form is produced by the generic database maintenance servlet (DBMaint).
 void setReturningValue(boolean value)
           
 void setSchema(String schemaName)
           
 void setSecret(String fieldName)
          Set a field as 'secret' - these fields are not shown when a list is produced by the generic database maintenance servlet.
 void setStringFilter(String fieldName, String filterMethod)
          Set a filter for a particular field.
 void setTargetDbCatalog(String theCatalog)
          Set the target database schema for this DBObject.
 void setTargetDbSchema(String theSchema)
          Set the target database schema for this DBObject.
 void setTargetStoreProcedure(String theStoreProcedure)
          Set the target store procedure for this DBObject.
 void setTargetTable(String theTable)
          Set the target table for this DBObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBObjectDef

public DBObjectDef()
Default Constructor. This allows a DB object to be dynamically instantiated (e.g. loaded with Class.forName()) and does all of the required initializations.

Method Detail

addField

public void addField(String fieldName,
                     String fieldType,
                     int fieldSize,
                     int fieldPrecision,
                     boolean allowNull,
                     String fieldDescription)
              throws DBException
Add a field with more details: This version allows the user to specify a precision, for fields that use both a size and precision.

Parameters:
fieldName - Name of the field
fieldType - Type of the field - this is the internal Expresso type, mapping in DBField to a specific database data type.
fieldSize - Size of the field
fieldPrecision - The precision of the field
allowNull - Does this field allow nulls?
fieldDescription - A longer description of this field (user-understandable hopefully!)
Throws:
DBException

setDefaultValue

public void setDefaultValue(String fieldName,
                            String fieldValue)
                     throws DBException
Sets the default value for a particular field

Parameters:
fieldName - The name of the field to set
fieldValue - the default value to use
Throws:
DBException - upon error

getDefaultValue

public String getDefaultValue(String fieldName)
Description copied from interface: DataObjectMetaData
Retreive the default value of a particular field for when it is first instantiated

Specified by:
getDefaultValue in interface DataObjectMetaData
Parameters:
fieldName - the name of the field to retrieve
Returns:
default value if found, or null

addDetail

public void addDetail(String objName,
                      String keyFieldsLocal,
                      String keyFieldsForeign)
               throws DBException
Specify a new "detail" db object, and the fields in this object they specify the fields in the related object

Parameters:
objName - The class name of the related object. There is assumed to be a one to one or one to many relationship from this object to the specified object
keyFieldsLocal - A pipe-delimited list of field names in this object
keyFieldsForeign - A pipe-delimieted list of field names in the other object
Throws:
DBException

getDetails

public Enumeration getDetails()

getDetailFieldsLocal

public String getDetailFieldsLocal(String detailName)
Description copied from interface: DataObjectMetaData
Retrieve the local key fields.

Specified by:
getDetailFieldsLocal in interface DataObjectMetaData
Parameters:
detailName - the name of the detail dbobject
Returns:
java.lang.String

getDetailFieldsForeign

public String getDetailFieldsForeign(String detailName)
Description copied from interface: DataObjectMetaData
Retrieve the foreign key fields

Specified by:
getDetailFieldsForeign in interface DataObjectMetaData
Parameters:
detailName - the name of the detail dbobject
Returns:
java.lang.String

addField

public void addField(String fieldName,
                     String fieldType,
                     int fieldSize,
                     boolean allowNull,
                     String fieldDescription)
              throws DBException
Add a field with more details: This version of addfield supplies the allowNull flags and a description of the field to be used when reporting errors to the user. This method is only used by the class that extends DB object, and typically only in the setupFields() method.

Parameters:
fieldName - Name of the field
fieldType - Type of the field - this is the "internal" Expresso type, and is mapped to a specific type for the database depending on the mappings in the properties file (if any). The DBField object contains the default mappings.
fieldSize - Size of this field, if specified for this type of field. For fields that do not use a size (such as "date"), specify 0 for the size.
allowNull - Does this field allow nulls?
fieldDescription - A longer description of this field (user-understandable hopefully!)
Throws:
DBException

addField

public void addField(String fieldName,
                     String fieldType,
                     int fieldSize,
                     boolean allowNull,
                     String descriptionKey,
                     String fieldDescription)
              throws DBException
Add a field with more details: This version of addfield supplies the allowNull flags and a description of the field to be used when reporting errors to the user. This method is only used by the class that extends DB object, and typically only in the setupFields() method.

Parameters:
fieldName - Name of the field
fieldType - Type of the field - this is the "internal" Expresso type, and is mapped to a specific type for the database depending on the mappings in the properties file (if any). The DBField object contains the default mappings.
fieldSize - Size of this field, if specified for this type of field. For fields that do not use a size (such as "date"), specify 0 for the size.
allowNull - Does this field allow nulls?
descriptionKey - Key into the local language files for this field's description
fieldDescription - A longer description of this field (user-understandable hopefully!)
Throws:
DBException

allowsNull

public boolean allowsNull(String fieldName)
                   throws DBException
Returns whether the field allows null values or not.

Parameters:
fieldName - name of the field
Returns:
true if the field allows null
Throws:
DBException

setMask

public void setMask(String fieldName,
                    String newMask)
             throws DBException
Sets the field's regular expression validation mask. It also precompiles the regular expression when it is called.

Parameters:
fieldName - The field name to associate with this regular expression
newMask - The actual regular expression.
Throws:
DBException

removeAttribute

public void removeAttribute(String fieldName,
                            String attribName)
Removes an attribute from the field.

Specified by:
removeAttribute in interface DataObjectMetaData
Parameters:
fieldName - the name of the field to remove the attribute
attribName - the attribute name to remove

setAttribute

public void setAttribute(String fieldName,
                         String attribName,
                         Object attribValue)
                  throws DBException
Specified by:
setAttribute in interface DataObjectMetaData
Parameters:
fieldName - the name of the field to set the attribute for
attribName - the name of the attribute to set
attribValue - the attribute to set
Throws:
DBException

getAttribute

public Object getAttribute(String fieldName,
                           String attribName)
                    throws DBException
Gets an Object attribute from the field's metatdata

Specified by:
getAttribute in interface DataObjectMetaData
Parameters:
fieldName - the name of the field for the attribute
attribName - the name of the attribute
Returns:
java.lang.Object
Throws:
DBException

getAttributesIterator

public Iterator getAttributesIterator(String fieldName)
                               throws DBException
Throws:
DBException

addIndex

public void addIndex(String indexName,
                     String fieldNames,
                     boolean isUnique)
              throws IllegalArgumentException
Add an index to the table.

Parameters:
indexName - the name to give the index in the table
fieldNames - A comma delimited list of all fields in the index.
isUnique - - True if this field is a unique index.
Throws:
IllegalArgumentException - of fieldName is null or doesn't exist or if indexName is null

addKey

public void addKey(String keyFieldName)
            throws DBException
Add a new field to the list of fields that are part of this object's key. Called after all of the "addField" calls in the setupFields() method to specify which fields make up the primary key of this object.

Parameters:
keyFieldName - The name of the field to add as part of the key
Throws:
DBException - if the field name is not valid or the field allows nulls

addVirtualField

public void addVirtualField(String fieldName,
                            String fieldType,
                            int fieldSize,
                            String fieldDescription)
                     throws DBException
Add a new virtual field to the definition of this object. A virtual field is just like a regular one, except it's not stored in the target table A normal call to getField or setField on a virtual field will throw an exception - getField and setField should be extended to handle the virtual fields for a particular object correctly.

Parameters:
fieldName - Name of the field
fieldType - Database type of the field
fieldSize - Size of the field in characters
fieldDescription - A longer description of this field (user-understandable hopefully!)
Throws:
DBException

addVirtualField

public void addVirtualField(String fieldName,
                            String fieldType,
                            int fieldSize,
                            String descriptionKey,
                            String fieldDescription)
                     throws DBException
Add a new virtual field to the definition of this object. A virtual field is just like a regular one, except it's not stored in the target table A normal call to getField or setField on a virtual field will throw an exception - getField and setField should be extended to handle the virtual fields for a particular object correctly.

Parameters:
fieldName - Name of the field
fieldType - Database type of the field
fieldSize - Size of the field in characters
descriptionKey - Key into the local language files for the description of this field.
fieldDescription - A longer description of this field (user-understandable hopefully!)
Throws:
DBException

addVirtualField

public void addVirtualField(String fieldName,
                            String fieldType,
                            int fieldSize,
                            int fieldPrecision,
                            boolean allowNull,
                            String fieldDescription)
                     throws DBException
Add a field with more details: This version allows the user to specify a precision, for fields that use both a size and precision.

Parameters:
fieldName - Name of the field
fieldType - Type of the field - this is the internal Expresso type, mapping in DBField to a specific database data type.
fieldSize - Size of the field
fieldPrecision - The precision of the field
allowNull - Does this field allow nulls?
fieldDescription - A longer description of this field (user-understandable hopefully!)
Throws:
DBException

addVirtualField

public void addVirtualField(String fieldName,
                            String fieldType,
                            int fieldSize,
                            int fieldPrecision,
                            boolean allowNull,
                            String descriptionKey,
                            String fieldDescription)
                     throws DBException
Add a field with more details: This version allows the user to specify a precision, for fields that use both a size and precision.

Parameters:
fieldName - Name of the field
fieldType - Type of the field - this is the internal Expresso type, mapping in DBField to a specific database data type.
fieldSize - Size of the field
fieldPrecision - The precision of the field
allowNull - Does this field allow nulls?
descriptionKey - Key into the local langauge files with a description of this field
fieldDescription - A longer description of this field (user-understandable hopefully!)
Throws:
DBException

disableLogging

public void disableLogging()
Disable change logging of this object

Specified by:
disableLogging in interface DataObjectMetaData

enableLogging

public void enableLogging()
Enable logging of changes to this object. Change logging writes an entry to the ChangeLog object every time an add, update, or delete is made to this object. It is used to track important tables, such as user information, account information, etc.

Specified by:
enableLogging in interface DataObjectMetaData

isLoggingEnabled

public boolean isLoggingEnabled()
Description copied from interface: DataObjectMetaData
Retrieves whether or not change logging is enabled for a particular data object

Specified by:
isLoggingEnabled in interface DataObjectMetaData
Returns:
boolean true if logging is enabled.

getAllFields

public Hashtable getAllFields()
Deprecated. use getAllFieldsMap instead

Return the "allFields" Hashtable, which contains all of the DBField objects that make up this DB object.

Returns:
Hashtable

isFieldIgnoreCase

public String isFieldIgnoreCase(String fieldName)
Check if a certain name is a field (of any kind) in this DBOBject since SQL is case insensitive, ignore case of field name for match, this method takes longer, so use isField if the field name is known precisely

Specified by:
isFieldIgnoreCase in interface DataObjectMetaData
Parameters:
fieldName - the name of the field to check
Returns:
internal format for field name if matched, or null if no match

isField

public boolean isField(String fieldName)
Check if a certain name is a field (of any kind) in this DBOBject

Specified by:
isField in interface DataObjectMetaData
Parameters:
fieldName - the name of the field to check
Returns:
true if the field name exists

getAllFieldsMap

public HashMap getAllFieldsMap()
Return the "allFields" Hashtable, which contains all of the DBField objects that make up this DB object.

Specified by:
getAllFieldsMap in interface DataObjectMetaData
Returns:
java.util.HashMap

getAllDBFields

public HashMap getAllDBFields()

getAllFieldsIterator

public Iterator getAllFieldsIterator()
Way to get an interator into the allFields objects

Returns:
an Iterator into the allFields HashMap

getKeyFieldListIterator

public Iterator getKeyFieldListIterator()
Retrieve an interator of key fields

Returns:
Iterator of key fields. [MetaData]

getAllKeys

public Hashtable getAllKeys()
Deprecated. Use getAllKeysMap or getAllKeysIterator instead

Return the "allKeys" hash, containing the DBField objects that make up the primary key for this db object.

Returns:
java.util.Hashtable

getAllKeysMap

public HashMap getAllKeysMap()
Return the "allKeys" hash, containing the DBField objects that make up the primary key for this db object.

Specified by:
getAllKeysMap in interface DataObjectMetaData
Returns:
java.util.HashMap

getAllKeysIterator

public Iterator getAllKeysIterator()
Non-threadsafe way to get an interator into the allKeys data structure

Returns:
java.util.Iterator of key fields (DBField)

getCharset

public String getCharset()
return the current object's character set

Specified by:
getCharset in interface DataObjectMetaData
Returns:
java.lang.String

getCacheSize

public int getCacheSize()
Get the current Cache size of this object. or -2 if it hasn't been defined yet.

Specified by:
getCacheSize in interface DataObjectMetaData
Returns:
current cache size value.

setCacheSize

public void setCacheSize(int newValue)
Sets the cache size for this DBObject

Specified by:
setCacheSize in interface DataObjectMetaData
Parameters:
newValue - the new value. Must be >= -2
Throws:
IllegalArgumentException - if newValue < -2

setCharset

public void setCharset(String newCharSet)
                throws DBException
Set a characterset for a particular field.

Parameters:
newCharSet - The name of the characterset that you will filter against. For Western-Latin character sets use "ISO-8859-1" as the parameter. Currently, no other charactersets are implemented.
Throws:
DBException - upon error
See Also:
for more information on Filters and implementing Filters for your own characterset.

Sets the characterset expected for a this DB object. A Table's default is "ISO-8859-1", Filter, ISO_8859_1


getDescription

public String getDescription()
Return a description of this database object. If no explicit description has been set, return the class name.

Specified by:
getDescription in interface DataObjectMetaData
Returns:
A string describing this database object

getDescription

public String getDescription(Locale l)
Retrieve the table description in a localized way. If l == null, the function uses the system locale to generate the value. If unable to locate the key in the message bundle, the key becomes the return value.

Specified by:
getDescription in interface DataObjectMetaData
Parameters:
l - the Locale to use for rendering the table description
Returns:
java.lang.String

getDescription

public String getDescription(String fieldName)
                      throws DBException
Return the long description of a field, if available

Specified by:
getDescription in interface DataObjectMetaData
Parameters:
fieldName - The name of the field
Returns:
String: The long description of the field (user-readable)
Throws:
DBException - If there is no such field

getDescription

public String getDescription(Locale l,
                             String fieldName)
Retrieve an i18n'ized description as per the locale defined for the 'client'

Specified by:
getDescription in interface DataObjectMetaData
Parameters:
l - the Locale to use. If null, will use the System default Locale
fieldName - the name of the field to retrieve the i18n'ized description for.
Returns:
an i18n'ized string. K

getDBField

public DBField getDBField(String fieldName)
Get the DBField object specified by the fieldname

Parameters:
fieldName - the name of the field to retrieve
Returns:
DBField object

getFieldList

public Enumeration getFieldList()
Deprecated. Use getFieldListArray or getFieldListIterator instead

Get a list of all of the fields in this object

Returns:
A Vector of all of the fieldNames in this object

getFieldListArray

public ArrayList getFieldListArray()
Get a list of all of the fields in this object This is threadsafe in that it makes a new copy of the fieldNamesInOrder ArrayList

Specified by:
getFieldListArray in interface DataObjectMetaData
Returns:
A Vector of all of the fieldNames in this object

getFieldListIterator

public Iterator getFieldListIterator()
Get a list of all of the fields in this object This iterator is not thread safe.

Returns:
An iterator of the fieldNamesInOrder array list

getKeyFieldList

public Enumeration getKeyFieldList()
Deprecated. Use getKeyFieldArray instead

Get a list of all of the names of the key fields in this object

Returns:
A Vector of all of the names of the key fields

getKeyFieldListArray

public ArrayList getKeyFieldListArray()
Get a list of all of the names of the key fields in this object

Specified by:
getKeyFieldListArray in interface DataObjectMetaData
Returns:
An ArrayList of all of the names of the key fields

getLength

public String getLength(String fieldName)
                 throws DBException
Return the length of a field

Specified by:
getLength in interface DataObjectMetaData
Parameters:
fieldName - The name of the field
Returns:
String: The length of the field
Throws:
DBException - If there is no such field in this object

getLengthInt

public int getLengthInt(String fieldName)
                 throws DBException
Description copied from interface: DataObjectMetaData
Return the length of a field as an integer

Specified by:
getLengthInt in interface DataObjectMetaData
Parameters:
fieldName - The name of the field
Returns:
integer: The length of the field
Throws:
DBException - If there is no such field in this object

getPrecision

public int getPrecision(String fieldName)
                 throws DBException
Description copied from interface: DataObjectMetaData
Retrieve the precision of a particular field

Specified by:
getPrecision in interface DataObjectMetaData
Parameters:
fieldName - The name of the field
Returns:
integer for demcimal precision of the field
Throws:
DBException

getLookupObject

public String getLookupObject(String fieldName)
                       throws DBException
Get a field's lookup object - this is the name of another database object that can be used to look up valid values for this object. The lookup object for a field is set in the db objects setupFields method, and is used by the DBMaint servlet to provide automatic lookup links for fields.

Specified by:
getLookupObject in interface DataObjectMetaData
Parameters:
fieldName - Field name to check
Returns:
String specifying the className of the lookup object
Throws:
DBException - If the specified field does not exist.

getLookupField

public String getLookupField(String fieldName)
When you get a lookup object, to perform a complete mapping between the two, you need to know what field name in the remote object maps to this field.

Specified by:
getLookupField in interface DataObjectMetaData
Parameters:
fieldName - the name of the field to look up.
Returns:
java.lang.String or null if there is no lookup field
Throws:
IllegalArgumentException - if the field name does not exist

getName

public String getName()
Get the name of this object

Specified by:
getName in interface DataObjectMetaData
Returns:
String The database object name, or the table name if none has been assigned

getTargetTable

public String getTargetTable()
                      throws DataException
Return the Table Name of the current database object. Keep in mind that a database object could update or affect other tables as well.

Specified by:
getTargetTable in interface JDBCObjectMetaData
Returns:
String: Table name of the target table of this database object
Throws:
DataException - upon error

getTargetDbSchema

public String getTargetDbSchema()
Return the Schema Name of the current database object.

Specified by:
getTargetDbSchema in interface JDBCObjectMetaData
Returns:
String: Schema name of the target table of this database object

author Yves Henri AMAIZO


getTargetDbCatalog

public String getTargetDbCatalog()
Return the Schema Name of the current database object.

Specified by:
getTargetDbCatalog in interface JDBCObjectMetaData
Returns:
String: Schema name of the target table of this database object

author Yves Henri AMAIZO


getType

public String getType(String fieldName)
               throws DBException
Return the type of a field - this method returns the internal Expresso type

Specified by:
getType in interface DataObjectMetaData
Parameters:
fieldName - The name of the field
Returns:
String: The type of the field
Throws:
DBException - If there is no such field in this object

getIndexArray

public Object[] getIndexArray()
Get an array of DBIndex objects for purpose of creating them through the schema. Return type should actually be DBIndex. Please Note This may cause an exception to be thrown if indexList is null. Call hasIndex() first before calling getIndexArray

Returns:
Object[]

hasIndex

public boolean hasIndex()
Returns true if an Index exists for this array.

Specified by:
hasIndex in interface JDBCObjectMetaData
Returns:
true if it has an index

hasField

public boolean hasField(String fieldName)
This method will return a boolean true if the field is defined in the DBOBject, false otherwise. Creation date: (8/8/00 11:04:32 AM)

Specified by:
hasField in interface DataObjectMetaData
Parameters:
fieldName - java.lang.String
Returns:
boolean

getFilterManager

public FilterManager getFilterManager()

isMultiValued

public boolean isMultiValued(String fieldName)
                      throws DBException
Method called to determine if a particular field is multi-valued, that is does it have a set of specific values and descriptions

Specified by:
isMultiValued in interface DataObjectMetaData
Parameters:
fieldName - Name of the field
Returns:
boolean True if the field is multi-valued, false if not
Throws:
DBException - If there is no such field

isReadOnly

public boolean isReadOnly(String fieldName)
                   throws DBException
Is a given field readOnly - these fields are not offered for entry when a form is produced by the generic database maintenance servlet

Specified by:
isReadOnly in interface DataObjectMetaData
Parameters:
fieldName - name of the field to check
Returns:
true of the field is "read only", false if it is not
Throws:
DBException - Ff there is no such field

isSecret

public boolean isSecret(String fieldName)
                 throws DBException
Is a given field 'secret' - these fields are not shown when a list is produced by the generic database maintenance servlet (DBMaint). This means that only users with update permission to the record can see the value of the specified field.

Specified by:
isSecret in interface DataObjectMetaData
Parameters:
fieldName - The name of the field to check
Returns:
True if the field is 'secret', false if it is not
Throws:
DBException - If there is no such field.
See Also:
setSecret(String)

isVirtual

public boolean isVirtual(String fieldName)
                  throws DBException
Is a given field virtual? A virtual field is not stored in the target table for this object - it may be computed, or stored in another table.

Specified by:
isVirtual in interface DataObjectMetaData
Parameters:
fieldName - The name of the field to check
Returns:
True of the field is virtual, false if it is not
Throws:
DBException - If there is no such field
See Also:
addVirtualField(String, String, int, String)

setCheckZeroUpdate

public void setCheckZeroUpdate(boolean newFlag)
Turn on or off the facility to verify that when an update is made that at least one record got updated. If this flag is on, and no records get updated, the update() method throws an Exception. Note that for some databases, if the existing record is not changed (e.g. it was already identical to what was being updated) this counts "no update" (notably, mySQL does this).

Specified by:
setCheckZeroUpdate in interface DataObjectMetaData
Parameters:
newFlag - True to turn on checking, false to turn it off

checkZeroUpdate

public boolean checkZeroUpdate()
Description copied from interface: DataObjectMetaData
Retrieves whether or not checkZeroUpdate is enabled for this data object

Specified by:
checkZeroUpdate in interface DataObjectMetaData
Returns:
true if checkZeroUpdate() is enabled

setDescription

public void setDescription(String newDescription)
Set the description of this object

Parameters:
newDescription - A description of this database object

setLookupObject

public void setLookupObject(String fieldName,
                            String objectName)
                     throws DBException
Set a field's lookup object - this is the name of another database object that can be used to look up valid values for this object. This value is used by the DBMaint servlet to provide automatic lookup ability for related fields.

Parameters:
fieldName - The field name that this lookup is associated with
objectName - The db object used to look up valid values for this field.
Throws:
DBException

setMultiValued

public void setMultiValued(String fieldName)
                    throws DBException
Set this field to be multi-valued - e.g. there is a specific list of values that are valid for this field. There should be code in the getValidValues method that returns the valid values for the specified multi-valued field.

Parameters:
fieldName - The name of the field to specify as multi-valued
Throws:
DBException - If the field name given is not valid, or is a virtual field

setName

public void setName(String theName)
Set the name of this object - this name is used to identify the db object with a more human-readable description

Parameters:
theName - New name for this object

setReadOnly

public void setReadOnly(String fieldName)
                 throws DBException
Set a field as read-only - these fields are not offered for update when a form is produced by the generic database maintenance servlet (DBMaint). It does not otherwise affect the use of the field.

Typical uses are for serial-numbered fields and timestamps

Parameters:
fieldName - The name of the field to be reserved as normally read-only.
Throws:
DBException - If there is no such field.

setSecret

public void setSecret(String fieldName)
               throws DBException
Set a field as 'secret' - these fields are not shown when a list is produced by the generic database maintenance servlet. In this way, only users with update permission to the object can view the values of "secret" fields.

Parameters:
fieldName - The name of the field to set as 'secret'
Throws:
DBException - if the field does not exist

setStringFilter

public void setStringFilter(String fieldName,
                            String filterMethod)
                     throws DBException
Set a filter for a particular field. Check the documentation at

Parameters:
fieldName - The name of the field to set a particular filter for.
filterMethod - The name of the filter method to use when calling a filter. Can be one of three values:
See @see com.jcorporate.expresso.core.security.filters.FilterManager.filterString for more information on this parameter.
Throws:
DBException - if: fieldName doesn't exist, or filterType String isn't a valid value.
See Also:
for more information on Filters and implementing Filters for your own characterset.

setTargetTable

public void setTargetTable(String theTable)
                    throws DBException
Set the target table for this DBObject. Note that an object can span tables by the use of virtual fields, but that this table is the default table for the object.

Parameters:
theTable - Table for this object
Throws:
DBException

setTargetDbSchema

public void setTargetDbSchema(String theSchema)
                       throws DBException
Set the target database schema for this DBObject.

Parameters:
theSchema - database schema for this object
Throws:
DBException - author Yves Henri AMAIZO

setTargetDbCatalog

public void setTargetDbCatalog(String theCatalog)
                        throws DBException
Set the target database schema for this DBObject.

Parameters:
theCatalog - database schema for this object
Throws:
DBException - author Yves Henri AMAIZO

setSchema

public void setSchema(String schemaName)
Parameters:
schemaName - the name of the schema

getSchema

public String getSchema()
Description copied from interface: DataObjectMetaData
Retrieve the schema object's class name associated with this data object

Specified by:
getSchema in interface DataObjectMetaData
Returns:
the className of the schema associated with this DBObject

getFields

public String[] getFields()

This convenience method iterates through all the fields belonging to this DBObject returns an array of field names ( String ).

Specified by:
getFields in interface DataObjectMetaData
Returns:
String array of all field names in this object.

author Peter Pilgrim

See Also:
getFieldList()

addTransition

public void addTransition(Transition t)
                   throws DBException
??????

Parameters:
t - ???
Throws:
DBException

getTransitionsIterator

public Iterator getTransitionsIterator()
                                throws DBException
????????????

Returns:
Iterator to the TransitionTabs
Throws:
DBException

getDetailSet

public Set getDetailSet()
Retrieve a set of detail objects.

Specified by:
getDetailSet in interface DataObjectMetaData
Returns:
java.util.Set

isAllowsNull

public boolean isAllowsNull(String fieldName)
                     throws DBException
Returns whether the field allows null values or not.

Specified by:
isAllowsNull in interface DataObjectMetaData
Parameters:
fieldName - name of the field
Returns:
true if the field allows null
Throws:
DBException

getFieldMetadata

public DataFieldMetaData getFieldMetadata(String fieldName)
Retrieve the metadata for the field.

Specified by:
getFieldMetadata in interface DataObjectMetaData
Parameters:
fieldName - the name of the field to retrieve the metadata for.
Returns:
DataFieldMetaData instance for the specified field name.

getAllAttributes

public Set getAllAttributes(String fieldName)
Retrieve all the attributes so you can iterate through them.

Specified by:
getAllAttributes in interface DataObjectMetaData
Parameters:
fieldName - the name of the field to retrieve.
Returns:
java.util.Set of all the attribute names for the given field.

getTargetStoreProcedure

public String getTargetStoreProcedure()
                               throws DataException
Return the Store procedure Name of the current database object. Keep in mind that a database object could update or affect other tables as well.

Returns:
String: Store procedure name of the target table of this database object
Throws:
DataException - upon error

author Yves Henri AMAIZO


setTargetStoreProcedure

public void setTargetStoreProcedure(String theStoreProcedure)
                             throws DBException
Set the target store procedure for this DBObject.

Parameters:
theStoreProcedure - Store procedure for this object
Throws:
DBException

addInParam

public void addInParam(String inFieldName)
                throws DBException
Add a new field to the list of fields that are part of this object's list of input parameters. Called after all of the "addField" calls in the setupFields() method to specify which fields make up the parameter fields of this object.

Parameters:
inFieldName - The name of the field to add as part of the input parameter
Throws:
DBException - if the field name is not valid or the field allows nulls

addOutParam

public void addOutParam(String outFieldName)
                 throws DBException
Add a new field to the list of fields that are part of this object's list of output parameter. Called after all of the "addField" calls in the setupFields() method to specify which fields make up the parameter fields of this object.

Parameters:
outFieldName - The name of the field to add as part of the output parameter
Throws:
DBException - if the field name is not valid or the field allows nulls

isReturningValue

public boolean isReturningValue()

setReturningValue

public void setReturningValue(boolean value)
Parameters:
value - returning value to be set

isOutField

public boolean isOutField(String fieldName)
Check if a certain name is a INPUT field parameter(of any kind) in this DBOBject

Parameters:
fieldName - the name of the field to check
Returns:
true if the field name exists

isInField

public boolean isInField(String fieldName)
Check if a certain name is a OUTPUT field parameter(of any kind) in this DBOBject

Parameters:
fieldName - the name of the field to check
Returns:
true if the field name exists

getTargetSQLTable

public String getTargetSQLTable(String dataContext)
                         throws DataException
Return the Table Name of the current database object. Keep in mind that a database object could update or affect other tables as well.

Specified by:
getTargetSQLTable in interface JDBCObjectMetaData
Parameters:
dataContext - The target data context.
Returns:
String: Table name of the target table of this database object
Throws:
DataException - upon error

author Yves Henri AMAIZO


getInParamListArray

public ArrayList getInParamListArray()
Get a list of all of the names of the IN param fields in this object

Returns:
An ArrayList of all of the names of the IN param fields

getOutParamListArray

public ArrayList getOutParamListArray()
Get a list of all of the names of the OUT param fields in this object

Returns:
An ArrayList of all of the names of the OUT param fields

getInParamFieldListIterator

public Iterator getInParamFieldListIterator()
Retrieve an interator of IN param fields

Returns:
Iterator of IN param fields. [MetaData]

getOutParamFieldListIterator

public Iterator getOutParamFieldListIterator()
Retrieve an interator of IN param fields

Returns:
Iterator of IN param fields. [MetaData]

getOutParamFieldsCount

public int getOutParamFieldsCount()
                           throws DBException
This convenience method counts DBFields belonging to this DBObject that are set to retrieve. author Yves Henri Amaizo

Returns:
int number of retrieve fields.
Throws:
DBException

Expresso 5-6

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