| com.jcorporate.expresso.core.dataobjects.DataObjectMetaData
All known Subclasses: com.jcorporate.expresso.core.dataobjects.jdbc.JoinedDataObjectMetaData,
DataObjectMetaData | public interface DataObjectMetaData extends java.io.Serializable(Code) | | This interface 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 Rimov |
Method Summary | |
public boolean | checkZeroUpdate() | public void | disableLogging() | public void | enableLogging() Enable logging of changes to this object. | public java.util.Set | getAllAttributes(String fieldName) Retrieve all the attributes so you can iterate through them. | public HashMap | getAllFieldsMap() Return the "allFields" Hashtable, which contains all of the DBField objects
that make up this DB object. | public HashMap | getAllKeysMap() Return the "allKeys" hash, containing the DBField objects that make up
the primary key for this db object. | public Object | getAttribute(String fieldName, String attribName) | public int | getCacheSize() Get the current Cache size of this object. | public String | getCharset() | public String | getDefaultValue(String fieldName) | public String | getDescription() Return a description of this database object. | public String | getDescription(String fieldName) | public String | getDescription(java.util.Locale l, String fieldName) Retrieve an localized description as per the locale defined for the
'client'
Parameters: l - the Locale to use. | public String | getDescription(java.util.Locale l) Retrieve the table description in a localized way. | public String | getDetailFieldsForeign(String detailName) | public String | getDetailFieldsLocal(String detailName) Retrieve the local key fields. | public Set | getDetailSet() | public ArrayList | getFieldListArray() | public DataFieldMetaData | getFieldMetadata(String fieldName) | public String[] | getFields() | public ArrayList | getKeyFieldListArray() | public String | getLength(String fieldName) | public int | getLengthInt(String fieldName) | 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.
Parameters: fieldName - the name of the field to look up. | public 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. | public String | getName() | public int | getPrecision(String fieldName) | public String | getSchema() | public String | getType(String fieldName) | public boolean | hasField(String fieldName) This method will return a boolean true if the field is defined in the DBOBject,
false otherwise. | public boolean | isAllowsNull(String fieldName) Returns whether the field allows null values or not. | boolean | isField(String fieldName) | public String | isFieldIgnoreCase(String fieldName) | public boolean | isLoggingEnabled() | public boolean | isMultiValued(String fieldName) | public boolean | isReadOnly(String fieldName) | public 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). | public boolean | isVirtual(String fieldName) 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. | public void | removeAttribute(String fieldName, String attribName) Removes an attribute from the field. | public void | setAttribute(String fieldName, String attribName, Object attribValue) | public void | setCacheSize(int newValue) Sets the cache size for this DBObject
Parameters: newValue - the new value. | 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. |
checkZeroUpdate | public boolean checkZeroUpdate()(Code) | | Retrieves whether or not checkZeroUpdate is enabled for this data object
true if checkZeroUpdate() is enabled |
disableLogging | public void disableLogging()(Code) | | Disable change logging of all objects of this type
|
enableLogging | public void enableLogging()(Code) | | 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.
|
getAllAttributes | public java.util.Set getAllAttributes(String fieldName)(Code) | | Retrieve all the attributes so you can iterate through them.
Parameters: fieldName - the name of the field to get all the attributes java.util.Set of all attributes. |
getAllFieldsMap | public HashMap getAllFieldsMap()(Code) | | Return the "allFields" Hashtable, which contains all of the DBField objects
that make up this DB object.
java.util.HashMap |
getAllKeysMap | public HashMap getAllKeysMap()(Code) | | Return the "allKeys" hash, containing the DBField objects that make up
the primary key for this db object.
java.util.HashMap |
getAttribute | public Object getAttribute(String fieldName, String attribName) throws DBException(Code) | | Gets an Object attribute from the field's metatdata
Parameters: fieldName - the name of the field for the attribute Parameters: attribName - the name of the attribute java.lang.Object |
getCacheSize | public int getCacheSize()(Code) | | Get the current Cache size of this object. or -2 if it hasn't been
defined yet.
current cache size value. |
getCharset | public String getCharset()(Code) | | return the current object's character set
java.lang.String |
getDefaultValue | public String getDefaultValue(String fieldName)(Code) | | Retreive the default value of a particular field for when it is first
instantiated
Parameters: fieldName - the name of the field to retrieve java.lang.String |
getDescription | public String getDescription()(Code) | | Return a description of this database object. If no explicit description has
been set, return the class name.
A string describing this database object |
getDescription | public String getDescription(String fieldName) throws DBException(Code) | | Return the long description of a field, if available
Parameters: fieldName - The name of the field String: The long description of the field (user-readable) throws: DBException - If there is no such field |
getDescription | public String getDescription(java.util.Locale l, String fieldName)(Code) | | Retrieve an localized description as per the locale defined for the
'client'
Parameters: l - the Locale to use. If null, will use the System default Locale Parameters: fieldName - the name of the field to retrieve the i18n'ized descriptionfor. the localized description of the field name |
getDescription | public String getDescription(java.util.Locale l)(Code) | | 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.
Parameters: l - the Locale to use for rendering the table description java.lang.String |
getDetailFieldsForeign | public String getDetailFieldsForeign(String detailName)(Code) | | Retrieve the foreign key fields
Parameters: detailName - the name of the detail dbobject java.lang.String |
getDetailFieldsLocal | public String getDetailFieldsLocal(String detailName)(Code) | | Retrieve the local key fields.
Parameters: detailName - the name of the detail dbobject java.lang.String |
getDetailSet | public Set getDetailSet()(Code) | | Retrieve a list of all the detail objects
java.util.Set |
getFieldListArray | public ArrayList getFieldListArray()(Code) | | 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
An array of all of the fieldNames in this object |
getFieldMetadata | public DataFieldMetaData getFieldMetadata(String fieldName)(Code) | | Get the DBField object specified by the fieldname
Parameters: fieldName - the name of the field to retrieve DBField object |
getFields | public String[] getFields()(Code) | | This convenience method iterates through all the
fields belonging to this DBObject
returns an array of field names ( String ).
String array of all field names in this object. author: Peter Pilgrim See Also: DataObjectMetaData.getFieldList() |
getKeyFieldListArray | public ArrayList getKeyFieldListArray()(Code) | | Get a list of all of the names of the key fields in this object
An ArrayList of all of the names of the key fields |
getLength | public String getLength(String fieldName) throws DBException(Code) | | Return the length of a field
Parameters: fieldName - The name of the field 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(Code) | | Return the length of a field as an integer
Parameters: fieldName - The name of the field integer: The length of the field throws: DBException - If there is no such field in this object |
getLookupField | public String getLookupField(String fieldName)(Code) | | 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.
Parameters: fieldName - the name of the field to look up. java.lang.String or null if there is no lookup field throws: IllegalArgumentException - if the field name does not exist |
getLookupObject | public String getLookupObject(String fieldName) throws DBException(Code) | | 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.
Parameters: fieldName - Field name to check String specifying the className of the lookup object throws: DBException - If the specified field does not exist. |
getName | public String getName()(Code) | | Get the name of this object
String The database object name, or the table name if nonehas been assigned |
getPrecision | public int getPrecision(String fieldName) throws DBException(Code) | | Retrieve the precision of a particular field
Parameters: fieldName - The name of the field integer for demcimal precision of the field |
getSchema | public String getSchema()(Code) | | Retrieve the schema object's class name associated with this data object
the className of the schema associated with this DBObject |
getType | public String getType(String fieldName) throws DBException(Code) | | Return the type of a field - this method returns the internal Expresso type
Parameters: fieldName - The name of the field String: The type of the field throws: DBException - If there is no such field in this object |
hasField | public boolean hasField(String fieldName)(Code) | | 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)
Parameters: fieldName - java.lang.String boolean |
isAllowsNull | public boolean isAllowsNull(String fieldName) throws DBException(Code) | | Returns whether the field allows null values or not.
Parameters: fieldName - name of the field true if the field allows null |
isField | boolean isField(String fieldName)(Code) | | Check if a certain name is a field (of any kind) in this DBOBject
Parameters: fieldName - the name of the field to check true if the field name exists |
isFieldIgnoreCase | public String isFieldIgnoreCase(String fieldName)(Code) | | 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
Parameters: fieldName - the name of the field to check internal format for field name if matched, or null if no match |
isLoggingEnabled | public boolean isLoggingEnabled()(Code) | | Retrieves whether or not change logging is enabled for a particular
data object
boolean true if logging is enabled. |
isMultiValued | public boolean isMultiValued(String fieldName) throws DBException(Code) | | Method called to determine if a particular field is multi-valued,
that is does it have a set of specific values and descriptions
Parameters: fieldName - Name of the field 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(Code) | | Is a given field readOnly - these fields are not offered for entry
when a form is produced by the generic database maintenance servlet
Parameters: fieldName - name of the field to check 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(Code) | | 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.
Parameters: fieldName - The name of the field to check True if the field is 'secret', false if it is not throws: DBException - If there is no such field. |
isVirtual | public boolean isVirtual(String fieldName) throws DBException(Code) | | 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.
Parameters: fieldName - The name of the field to check True of the field is virtual, false if it is not throws: DBException - If there is no such field |
removeAttribute | public void removeAttribute(String fieldName, String attribName)(Code) | | Removes an attribute from the field.
Parameters: fieldName - the name of the field to remove the attribute Parameters: attribName - the attribute name to remove |
setAttribute | public void setAttribute(String fieldName, String attribName, Object attribValue) throws DBException(Code) | | Parameters: fieldName - the name of the field to set the attribute for Parameters: attribName - the name of the attribute to set Parameters: attribValue - the attribute to set |
setCacheSize | public void setCacheSize(int newValue)(Code) | | Sets the cache size for this DBObject
Parameters: newValue - the new value. Must be >= -2 throws: IllegalArgumentException - if newValue < -2 |
setCheckZeroUpdate | public void setCheckZeroUpdate(boolean newFlag)(Code) | | 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).
Parameters: newFlag - True to turn on checking, false to turn it off |
|
|