com.extentech.ExtenBean
Interface DataObject

All Superinterfaces:
RelationalObject, Serializable, SimpleDataObject, SQLObject
All Known Subinterfaces:
PageableDataObject
All Known Implementing Classes:
CellRangeDataObject, DataObjectImpl, ExtenBeanTreeNode, ExtenDataObject, GenericDataObject, NamedRangeDataObject, XMLBeanNode, XMLDataObject

public interface DataObject
extends SimpleDataObject, RelationalObject, SQLObject, Serializable

Interface defining a Data Object encapsulating data. DataObject can store data as a singleton object which represents a single item with named field values or DataObject can store data in a recordset-like fashion of rows of singleton DataObjects Furthermore, DataObjects can be hierarchical and maintain a child-parent relationship:

Since:
1.3
Version:
2.01
Author:
John McMahon -- Copyright ©2011Extentech Inc.
See Also:
interface. SQLObject interface provides for loading of data from underlying SQL-based data sources although this should be refactored to be persistence layer agnostic and throw a StorageException (@see com.extentech.ExtenXLS.plugin.integration.Storage), ExtenDataObject, RelationalObject, SQLObject

Method Summary
 void activate()
          load the data from the underlying persistence layer
 void addDataObjectActionListener(DataObjectActionListener e)
          add a DataObjectActionListener
 void addOrderByItem(int i, Object o)
           
 void fireDataObjectActionEvent(DataObject dob)
          fires a DataObjectAction event
 boolean getCascadeUpdates()
          get whether or not to cascade the updates to child dataobjects
 int getChangedRowCount()
           
 Object[] getChangedRows()
           
 DataObject getChildByName(String name)
           
 colinfo[] getColinfo()
          Returns the column metadata for this row of data.
 colinfo getColinfoByName(String colname)
           
 Vector getColnames()
           
 int getColNumByName(String colname)
          Find the column number in the data array which contains the column represented by this columnname.
 Map getData()
           
 List getDataObjectActionListeners()
          retrurns all of the DataObjectActionListeners for this DataObject
 Object[] getDataRow(int i)
          Get the data fields as an array of objects.
 String getDOLookupField()
           
 PersistenceEngine getFactory()
           
 int getId()
           
 boolean getIsMultiple()
           
 boolean getIsNew()
           
 int getNumRows()
           
 Hashtable getOrderByHash()
           
 String getStringVal(int idx, String col)
          return the String value for the named column (field) at the row index specified ie: '0' for singleton DataObjects
 Object getVal(int idx, String col)
          get the value for the object at the row index and the column (field) specified
 Object getVal(Object key, String col)
          get the value for the named object at the column (field) specified
 Object getVal(String field)
           
 void init()
          Post-data initialization tasks.
 boolean isPageable()
           
 void load()
          load the data from the underlying persistence layer
 void passivate()
          load the data from the underlying persistence layer
 void remove()
          load the data from the underlying persistence layer
 void removeChangedRow(Object o)
          removes a changed row identified by the Object index
 void removeChangedRows()
           
 void removeDataObjectActionListener(DataObjectActionListener e)
          remove a DataObjectActionListener
 void removeDataObjectActionListeners()
          remove a DataObjectActionListener
 void setCascadeUpdates(boolean b)
          set whether or not to cascade the updates to child dataobjects
 void setColinfo(colinfo[] c)
          set the array of colinfos for this DataObject
 void setDOLookupField(String s)
          set the lookup (unique id) field for this DataObject
 void setFactory(PersistenceEngine fact)
          set the DataObject persistence engine (Factory) for this DataObject
 void setId(int id)
          set the Id for this DataObject
 void setIsMultiple(boolean b)
           
 void setIsNew(boolean b)
           
 void setVal(int row, String col, Object val)
          set the value of the field for the named column (field) to the new value object at the specified row index
 void setVal(String col, Object val)
          set the value of the field for the named column (field) to the new value object
 void store()
          load the data from the underlying persistence layer
 
Methods inherited from interface com.extentech.ExtenBean.SimpleDataObject
getColNames, getDataObject, getStringVal, isNew
 
Methods inherited from interface com.extentech.ExtenBean.RelationalObject
addChildObject, getAllChildrenInHeirarchy, getChildObjects, getLevel, getParentObject, hasChildren, setLevel, setParent
 
Methods inherited from interface com.extentech.ExtenBean.SQLObject
beginTrans, getIsUpdateable, getKeyCol, getKeyColName, getParentForeignKey, getParentId, getSQL, getTableName, rollBack, setData, setIsUpdateable, setKeyCol, setKeyCol, setParentForeignKey, setSQL, setTableName
 

Method Detail

activate

void activate()
              throws SQLException
load the data from the underlying persistence layer

Throws:
SQLException

addDataObjectActionListener

void addDataObjectActionListener(DataObjectActionListener e)
add a DataObjectActionListener

Parameters:
e -

addOrderByItem

void addOrderByItem(int i,
                    Object o)

fireDataObjectActionEvent

void fireDataObjectActionEvent(DataObject dob)
fires a DataObjectAction event

Parameters:
dob -

getCascadeUpdates

boolean getCascadeUpdates()
get whether or not to cascade the updates to child dataobjects


getChangedRowCount

int getChangedRowCount()

getChangedRows

Object[] getChangedRows()

getChildByName

DataObject getChildByName(String name)

getColinfo

colinfo[] getColinfo()
Returns the column metadata for this row of data.

Specified by:
getColinfo in interface SimpleDataObject
Returns:
An array of colinfo objects containing

getColinfoByName

colinfo getColinfoByName(String colname)
Specified by:
getColinfoByName in interface SimpleDataObject

getColnames

Vector getColnames()

getColNumByName

int getColNumByName(String colname)
Find the column number in the data array which contains the column represented by this columnname.


getData

Map getData()

getDataObjectActionListeners

List getDataObjectActionListeners()
retrurns all of the DataObjectActionListeners for this DataObject

Returns:
the List of DataObjectActionListeners

getDataRow

Object[] getDataRow(int i)
Get the data fields as an array of objects. Type information is contained in the colinfo for this object.

Specified by:
getDataRow in interface SimpleDataObject
Returns:
An array of values from a database

getDOLookupField

String getDOLookupField()

getFactory

PersistenceEngine getFactory()

getId

int getId()

getIsMultiple

boolean getIsMultiple()
Specified by:
getIsMultiple in interface SimpleDataObject

getIsNew

boolean getIsNew()

getNumRows

int getNumRows()
Specified by:
getNumRows in interface SimpleDataObject

getOrderByHash

Hashtable getOrderByHash()

getStringVal

String getStringVal(int idx,
                    String col)
return the String value for the named column (field) at the row index specified ie: '0' for singleton DataObjects

Specified by:
getStringVal in interface SimpleDataObject
Parameters:
idx -
col -
Returns:

getVal

Object getVal(int idx,
              String col)
get the value for the object at the row index and the column (field) specified

Specified by:
getVal in interface SimpleDataObject
Parameters:
key -
col -
Returns:

getVal

Object getVal(Object key,
              String col)
get the value for the named object at the column (field) specified

Parameters:
key -
col -
Returns:

getVal

Object getVal(String field)
Specified by:
getVal in interface SimpleDataObject

init

void init()
Post-data initialization tasks.


isPageable

boolean isPageable()

load

void load()
          throws SQLException
load the data from the underlying persistence layer

Specified by:
load in interface SimpleDataObject
Throws:
SQLException

passivate

void passivate()
               throws SQLException
load the data from the underlying persistence layer

Throws:
SQLException

remove

void remove()
            throws SQLException
load the data from the underlying persistence layer

Specified by:
remove in interface SimpleDataObject
Throws:
SQLException

removeChangedRow

void removeChangedRow(Object o)
removes a changed row identified by the Object index

Parameters:
o -

removeChangedRows

void removeChangedRows()

removeDataObjectActionListener

void removeDataObjectActionListener(DataObjectActionListener e)
remove a DataObjectActionListener

Parameters:
e - - the dataobject to remvoe

removeDataObjectActionListeners

void removeDataObjectActionListeners()
remove a DataObjectActionListener


setCascadeUpdates

void setCascadeUpdates(boolean b)
set whether or not to cascade the updates to child dataobjects


setColinfo

void setColinfo(colinfo[] c)
set the array of colinfos for this DataObject

Parameters:
c -

setDOLookupField

void setDOLookupField(String s)
set the lookup (unique id) field for this DataObject

Parameters:
s -

setFactory

void setFactory(PersistenceEngine fact)
set the DataObject persistence engine (Factory) for this DataObject

Parameters:
fact -

setId

void setId(int id)
set the Id for this DataObject

Parameters:
id -

setIsMultiple

void setIsMultiple(boolean b)

setIsNew

void setIsNew(boolean b)

setVal

void setVal(int row,
            String col,
            Object val)
set the value of the field for the named column (field) to the new value object at the specified row index

Specified by:
setVal in interface SimpleDataObject
Parameters:
row -
col -
val -

setVal

void setVal(String col,
            Object val)
set the value of the field for the named column (field) to the new value object

Specified by:
setVal in interface SimpleDataObject
Parameters:
col -
val -

store

void store()
           throws SQLException
load the data from the underlying persistence layer

Specified by:
store in interface SimpleDataObject
Throws:
SQLException


Copyright © 2011 Extentech Inc. All Rights Reserved.