Expresso 5-6

com.jcorporate.expresso.core.dataobjects
Interface NestableDataObject

All Known Implementing Classes:
JoinedDataObject

public interface NestableDataObject

Nestable indicates that the derived class includes nested data objects.

While the dataobject 'cluster' should be able to be acted on as a single unit, once in a while, it is necessary to get at the internal or "nested" data objects.

An example of the Nestable usage is in com.jcorporate.expresso.services.controller.dbmaint.ViewBlob in conjunction with a com.jcorporate.expresso.cores.dataobjects.jdbc.JoinedDataObject. The ViewBlob routine needs to get to the low-level JDBC data objects rather than operate on the join as a whole. Since JoinedDataObject implements the Nestable interface. It is then possible to work with the underlying JDBCDataObjects in the join.

Author:
Michael Rimov

Method Summary
 DataObject[] getAllNested()
          Retrieve an array of all nested data objects.
 String getFieldFromNestedName(String fieldName)
          Often times, field names for the external interface will be different from the of a nested field name in a data object.
 DataObject getNestedFromFieldName(String fieldName)
          Retrieves a nested dataobject based upon the public field name that the DataObject publishes.
 

Method Detail

getNestedFromFieldName

public DataObject getNestedFromFieldName(String fieldName)
Retrieves a nested dataobject based upon the public field name that the DataObject publishes. For example, in JoinedDataObjects, the field name ""abcd.efgh" represents DataObject 'abcd', and field name 'efgh'.

The actual usage of the naming convention will differ from the, thus you'll need to use getMetaData().getFieldList() to get the names of the fields of a Nestable object to get a valid field Name

Parameters:
fieldName - the full field name to get the nested data object.
Returns:
DataObject or possibly null.
Throws:
IllegalArgumentException - if the field name does not map to any DataObject

getFieldFromNestedName

public String getFieldFromNestedName(String fieldName)
Often times, field names for the external interface will be different from the of a nested field name in a data object. Use this function to get the internal field name for the DataObject returned by getNestedFromFieldName()

Parameters:
fieldName - The external name of the field
Returns:
java.lang.String, the field corresponding to the field name of the data object
Throws:
IllegalArgumentException - if the given field name cannot map to a field.

getAllNested

public DataObject[] getAllNested()
Retrieve an array of all nested data objects. May be empty if there are no nested data objects. Ordering is undefined by this function.

Returns:
Array of DataObjects. Should never return null.

Expresso 5-6

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