|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.dataobjects.jdbc.JoinedDataObjectMetaData
Not yet released - do not use in your own code yet. This object provides an implementation of DataObjectMetaData that is used for the various join operations. It's job is to provide the descriptive services required for applications such as DBMaint to generically access the JoinedDataObject.
| Nested Class Summary | |
class |
JoinedDataObjectMetaData.FieldList
Bean-like class for keeping track of required fields |
class |
JoinedDataObjectMetaData.Relation
Bean-like class for keeping track of relations |
| Constructor Summary | |
JoinedDataObjectMetaData()
Default constructor |
|
| Method Summary | |
void |
addDataObject(Class dataObjectClass,
String definitionName,
String alias,
String fieldExpressionList)
Add a DB Object to the objects being used for this multidbobj query. |
boolean |
checkZeroUpdate()
Retrieves whether or not checkZeroUpdate is enabled for this data object |
HashMap |
createNestedDataObjects()
Creates a new copy of blank data objects for use in the main objects |
void |
disableLogging()
Disable change logging of all objects of this type |
void |
enableLogging()
Enable logging of changes to this object. |
List |
getAliasesInOrder()
Retrieves a list of Aliases in order that they were added |
Set |
getAllAttributes(String fieldName)
Retrieve all the attributes so you can iterate through them. |
protected Set |
getAllDetails()
|
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. |
Map |
getAllRelations()
Retrieve a list of all relations |
Object |
getAttribute(String fieldName,
String attribName)
Retrieve the attribute for the field |
int |
getCacheSize()
Retrieves the cache size for the primary object |
String |
getCharset()
return the current object's character set |
Map |
getDataObjects()
|
List |
getDataObjectsInOrder()
Retrieves a list of DataObjects that were used in Order |
String |
getDefaultValue(String fieldName)
Retrieve the default value for the specified |
String |
getDescription()
Retrieve the description of the dataobject join |
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)
Get the unlocalized description for a field name |
String |
getDetailFieldsForeign(String detailName)
Retrieve the foreign key fields |
String |
getDetailFieldsLocal(String detailName)
Retrieve the local key fields. |
Set |
getDetailSet()
Returns the detail set for the primary data object |
ArrayList |
getFieldListArray()
Retrieve a list of all the field names |
DataFieldMetaData |
getFieldMetadata(String fieldName)
Retrieve the metadata for the particular field |
String[] |
getFields()
This convenience method iterates through all the fields belonging to this DBObject
returns an array of field names ( String ). |
List |
getFieldsToRetrieve(String alias)
Return the List containing the details of fields to retrieve for the DataObject with the given alias |
protected HashMap |
getForeignKeyToPrimaryKeyMap()
|
ArrayList |
getKeyFieldListArray()
Retrieves the key field list array... which in reality is the key fields of the primary data 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. |
protected HashMap |
getMyDataObjects()
|
String |
getName()
Get the name of this object |
String[] |
getObjectAndField(String fieldName)
Utility method Retrieve the object name and the field name |
Map |
getPermissions()
|
int |
getPrecision(String fieldName)
Retrieve the precision of a particular field |
String |
getPrimaryAlias()
Retrieve the short name of the primary data object. |
protected HashMap |
getPrimaryToForeignKeyMap()
|
JoinedDataObjectMetaData.Relation |
getRelation(String aliaslocal,
String aliasJoined)
Retrieve the relation bean for between two aliases |
protected HashMap |
getRelations()
|
String |
getSchema()
Retrieve the schema class name |
protected List |
getSqlRelationList()
|
List |
getSQLRelationList()
Retrieve a list of precalculated relations for the where clauses. |
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)
Set the target table for this DBObject. |
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)
Retrieves whether the value is null |
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 |
isSelectDistinct()
Retrieve whether or not the Join should be distinct or not |
boolean |
isVirtual(String fieldName)
Is a given field virtual? |
void |
removeAttribute(String fieldName,
String attribName)
Removes the attribute specified by field name and attrib name |
void |
setAttribute(String fieldName,
String attribName,
Object attribValue)
Sets the attribute for the particular field |
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. |
void |
setDescription(String newDescription)
Sets the description for the data object join |
void |
setForeignKey(String shortName,
String foreignKey,
String shortName2,
String primaryKey,
int joinType)
Sets how the various dataobjects are connected, key-wise |
void |
setName(String theName)
Sets the name for this joined data object metadata... in this case the definition name |
void |
setPermissions(Map newPermissions)
|
void |
setSelectDistinct(boolean flag)
Specify that the DISTINCT keyword for unique rows must be specified right after the SELECT keyword |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JoinedDataObjectMetaData()
| Method Detail |
public Map getDataObjects()
public List getDataObjectsInOrder()
public List getAliasesInOrder()
public String getDefaultValue(String fieldName)
getDefaultValue in interface DataObjectMetaDatafieldName - the name of the field to check
public void addDataObject(Class dataObjectClass,
String definitionName,
String alias,
String fieldExpressionList)
throws DataException,
IllegalArgumentException
dataObjectClass - java.lang.Stringalias - java.lang.StringdefinitionName - [optional] The definition name if the DataObject is
DefineablefieldExpressionList - [optional] pipe-delimited list of fields to
retrieve for this DataObject
IllegalArgumentException - if the Class is inappropriate for the system.
DataExceptionpublic Set getDetailSet()
getDetailSet in interface DataObjectMetaDatapublic String getDetailFieldsLocal(String detailName)
getDetailFieldsLocal in interface DataObjectMetaDatadetailName - the name of the detail dbobject
public String getDetailFieldsForeign(String detailName)
getDetailFieldsForeign in interface DataObjectMetaDatadetailName - the name of the detail dbobject
public boolean isAllowsNull(String fieldName)
throws DBException
isAllowsNull in interface DataObjectMetaDatafieldName - the name of the field to check
DBException
public void removeAttribute(String fieldName,
String attribName)
removeAttribute in interface DataObjectMetaDatafieldName - the name of the field to modifyattribName - the attribute to remove
public void setAttribute(String fieldName,
String attribName,
Object attribValue)
throws DBException
setAttribute in interface DataObjectMetaDatafieldName - the name of the field to modifyattribName - the attribute to setattribValue - the value to set the attribute for.
DBException - upon error
public Object getAttribute(String fieldName,
String attribName)
throws DBException
getAttribute in interface DataObjectMetaDatafieldName - the field name to get the attribute forattribName - the attribute name
DBException - upon errorpublic void disableLogging()
disableLogging in interface DataObjectMetaDatapublic void enableLogging()
enableLogging in interface DataObjectMetaDatapublic boolean isLoggingEnabled()
isLoggingEnabled in interface DataObjectMetaDatapublic String isFieldIgnoreCase(String fieldName)
isFieldIgnoreCase in interface DataObjectMetaDatafieldName - the name of the field to check
public boolean isField(String fieldName)
isField in interface DataObjectMetaDatafieldName - the name of the field to check
public HashMap getAllFieldsMap()
getAllFieldsMap in interface DataObjectMetaDatapublic List getFieldsToRetrieve(String alias)
alias -
public HashMap getAllKeysMap()
getAllKeysMap in interface DataObjectMetaDatapublic String getCharset()
getCharset in interface DataObjectMetaDatapublic int getCacheSize()
getCacheSize in interface DataObjectMetaDatapublic void setCacheSize(int newValue)
setCacheSize in interface DataObjectMetaDatanewValue - the new value. Must be >= -2
IllegalArgumentException - if newValue < -2public String getDescription()
getDescription in interface DataObjectMetaData
public String getDescription(Locale l,
String fieldName)
getDescription in interface DataObjectMetaDatal - 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 String getDescription(String fieldName)
throws DBException
getDescription in interface DataObjectMetaDatafieldName - name of the field
DBException - upon errorpublic DataFieldMetaData getFieldMetadata(String fieldName)
getFieldMetadata in interface DataObjectMetaDatafieldName - the name of the field to retrieve the metadata
public ArrayList getFieldListArray()
getFieldListArray in interface DataObjectMetaDatapublic ArrayList getKeyFieldListArray()
getKeyFieldListArray in interface DataObjectMetaData
public String getLength(String fieldName)
throws DBException
getLength in interface DataObjectMetaDatafieldName - The name of the field
DBException - If there is no such field in this object
public int getLengthInt(String fieldName)
throws DBException
getLengthInt in interface DataObjectMetaDatafieldName - The name of the field
DBException - If there is no such field in this object
public int getPrecision(String fieldName)
throws DBException
getPrecision in interface DataObjectMetaDatafieldName - The name of the field
DBException
public String getLookupObject(String fieldName)
throws DBException
getLookupObject in interface DataObjectMetaDatafieldName - Field name to check
DBException - If the specified field does not exist.public String getLookupField(String fieldName)
getLookupField in interface DataObjectMetaDatafieldName - the name of the field to look up.
IllegalArgumentException - if the field name does not existpublic String getName()
getName in interface DataObjectMetaData
public String getType(String fieldName)
throws DBException
getType in interface DataObjectMetaDatafieldName - The name of the field
DBException - If there is no such field in this objectpublic boolean hasField(String fieldName)
hasField in interface DataObjectMetaDatafieldName - java.lang.String
public boolean isMultiValued(String fieldName)
throws DBException
isMultiValued in interface DataObjectMetaDatafieldName - Name of the field
DBException - If there is no such field
public boolean isReadOnly(String fieldName)
throws DBException
isReadOnly in interface DataObjectMetaDatafieldName - name of the field to check
DBException - Ff there is no such field
public boolean isSecret(String fieldName)
throws DBException
isSecret in interface DataObjectMetaDatafieldName - The name of the field to check
DBException - If there is no such field.
public boolean isVirtual(String fieldName)
throws DBException
isVirtual in interface DataObjectMetaDatafieldName - The name of the field to check
see #addVirtualField(String, String, int, String)
DBException - If there is no such fieldpublic void setCheckZeroUpdate(boolean newFlag)
setCheckZeroUpdate in interface DataObjectMetaDatanewFlag - True to turn on checking, false to turn it offpublic boolean checkZeroUpdate()
checkZeroUpdate in interface DataObjectMetaDatapublic void setDescription(String newDescription)
newDescription - the description to set for the Joinpublic void setName(String theName)
theName - the name of the join [Usually =='s the definition]public String getSchema()
getSchema in interface DataObjectMetaDatapublic String getTargetDbSchema()
DataException - upon error
author Yves Henri AMAIZO public String getTargetDbCatalog()
DataException - upon error
author Yves Henri AMAIZO
public String getTargetSQLTable(String dataContext)
throws DataException
DBException - author Yves Henri AMAIZO DataExceptionpublic String[] getFields()
This convenience method iterates through all the
fields belonging to this DBObject
returns an array of field names ( String ).
getFields in interface DataObjectMetaData#getFieldList()public String getDescription(Locale l)
getDescription in interface DataObjectMetaDatal - the Locale to use for rendering the table description
public void setSelectDistinct(boolean flag)
flag - true if DISTINCT supported right after SELECT, false
(default) otherwise.public Set getAllAttributes(String fieldName)
getAllAttributes in interface DataObjectMetaDatafieldName - the name of the field's attributes to retrieve
public boolean isSelectDistinct()
public void setForeignKey(String shortName,
String foreignKey,
String shortName2,
String primaryKey,
int joinType)
throws DBException
shortName - java.lang.String the local short nameforeignKey - java.lang.String the local keyshortName2 - java.lang.String the foreign short nameprimaryKey - java.lang.String the foreign keyjoinType - the type of Join
DBException - upon error
Modify by Yves Henri AMAIZO
public JoinedDataObjectMetaData.Relation getRelation(String aliaslocal,
String aliasJoined)
aliaslocal - the local aliasaliasJoined - the foreign alias
public Map getAllRelations()
public List getSQLRelationList()
public HashMap createNestedDataObjects()
throws DataException
DataException - upon construction errorpublic String getPrimaryAlias()
IllegalStateException - if there are improperly described relations in
the metadatapublic final String[] getObjectAndField(String fieldName)
fieldName - the [dataobject].field
protected Set getAllDetails()
protected HashMap getForeignKeyToPrimaryKeyMap()
protected HashMap getMyDataObjects()
public Map getPermissions()
public void setPermissions(Map newPermissions)
protected HashMap getPrimaryToForeignKeyMap()
protected HashMap getRelations()
protected List getSqlRelationList()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||