|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
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.
| Method Summary | |
boolean |
checkZeroUpdate()
Retrieves whether or not checkZeroUpdate is enabled for this data object |
void |
disableLogging()
Disable change logging of all objects of this type |
void |
enableLogging()
Enable logging of changes to this object. |
Set |
getAllAttributes(String fieldName)
Retrieve all the attributes so you can iterate through them. |
HashMap |
getAllFieldsMap()
Return the "allFields" Hashtable, which contains all of the DBField objects that make up this DB object. |
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 |
int |
getCacheSize()
Get the current Cache size of this object. |
String |
getCharset()
return the current object's character set |
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 localized 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. |
Set |
getDetailSet()
Retrieve a list of all the detail objects |
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 |
DataFieldMetaData |
getFieldMetadata(String fieldName)
Get the DBField object specified by the fieldname |
String[] |
getFields()
This convenience method iterates through all the fields belonging to this DBObject
returns an array of field names ( String ). |
ArrayList |
getKeyFieldListArray()
Get a list of all of the names of the key fields in this object |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
setCheckZeroUpdate(boolean newFlag)
Turn on or off the facility to verify that when an update is made that at least one record got updated. |
| Method Detail |
public String getDefaultValue(String fieldName)
fieldName - the name of the field to retrieve
public Set getDetailSet()
public String getDetailFieldsLocal(String detailName)
detailName - the name of the detail dbobject
public String getDetailFieldsForeign(String detailName)
detailName - the name of the detail dbobject
public boolean isAllowsNull(String fieldName)
throws DBException
fieldName - name of the field
DBException
public void removeAttribute(String fieldName,
String attribName)
fieldName - the name of the field to remove the attributeattribName - the attribute name to remove
public void setAttribute(String fieldName,
String attribName,
Object attribValue)
throws DBException
fieldName - the name of the field to set the attribute forattribName - the name of the attribute to setattribValue - the attribute to set
DBException
public Object getAttribute(String fieldName,
String attribName)
throws DBException
Object attribute from the field's metatdata
fieldName - the name of the field for the attributeattribName - the name of the attribute
DBExceptionpublic Set getAllAttributes(String fieldName)
fieldName - the name of the field to get all the attributes
public void disableLogging()
public void enableLogging()
public boolean isLoggingEnabled()
public String isFieldIgnoreCase(String fieldName)
fieldName - the name of the field to check
public boolean isField(String fieldName)
fieldName - the name of the field to check
public HashMap getAllFieldsMap()
public HashMap getAllKeysMap()
public String getCharset()
public int getCacheSize()
public void setCacheSize(int newValue)
newValue - the new value. Must be >= -2
IllegalArgumentException - if newValue < -2public String getDescription()
public String getDescription(String fieldName)
throws DBException
fieldName - The name of the field
DBException - If there is no such field
public String getDescription(Locale l,
String fieldName)
l - the Locale to use. If null, will use the System default LocalefieldName - the name of the field to retrieve the i18n'ized description
for.
public DataFieldMetaData getFieldMetadata(String fieldName)
fieldName - the name of the field to retrieve
DBField objectpublic ArrayList getFieldListArray()
public ArrayList getKeyFieldListArray()
public String getLength(String fieldName)
throws DBException
fieldName - The name of the field
DBException - If there is no such field in this object
public int getLengthInt(String fieldName)
throws DBException
fieldName - The name of the field
DBException - If there is no such field in this object
public int getPrecision(String fieldName)
throws DBException
fieldName - The name of the field
DBException
public String getLookupObject(String fieldName)
throws DBException
fieldName - Field name to check
DBException - If the specified field does not exist.public String getLookupField(String fieldName)
fieldName - the name of the field to look up.
IllegalArgumentException - if the field name does not existpublic String getName()
public String getType(String fieldName)
throws DBException
fieldName - The name of the field
DBException - If there is no such field in this objectpublic boolean hasField(String fieldName)
fieldName - java.lang.String
public boolean isMultiValued(String fieldName)
throws DBException
fieldName - Name of the field
DBException - If there is no such field
public boolean isReadOnly(String fieldName)
throws DBException
fieldName - name of the field to check
DBException - Ff there is no such field
public boolean isSecret(String fieldName)
throws DBException
fieldName - The name of the field to check
DBException - If there is no such field.
public boolean isVirtual(String fieldName)
throws DBException
fieldName - The name of the field to check
DBException - If there is no such fieldpublic void setCheckZeroUpdate(boolean newFlag)
newFlag - True to turn on checking, false to turn it offpublic boolean checkZeroUpdate()
public String getSchema()
public String[] getFields()
This convenience method iterates through all the
fields belonging to this DBObject
returns an array of field names ( String ).
#getFieldList()public String getDescription(Locale l)
l - the Locale to use for rendering the table description
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||