Expresso 5-6

com.jcorporate.expresso.core.dataobjects
Interface DataExecutorInterface

All Known Implementing Classes:
JDBCExecutor

public interface DataExecutorInterface

This class' job is to provide an interface between DataObjects and the underlying data source. It provides the actual execution. By separating the logic, we gain the ability to do things such as have the actual Execution take place on another machine. Just write an executor facade and be done with it.

Since:
Expresso 5.0
Author:
Michael Rimov

Method Summary
 void add(DataObject valueObject)
          Takes a DataObject and adds it to the underlying data source
 void addBatch(List valueObjectList)
          Adds an entire batch of DataObjects to the underlying data source
 void delete(DataObject valueObject)
          Takes a DataObject and deletes it from the underlying data source
 void deleteAll(DataObject valueObject, boolean deleteChangedCache)
          Takes a DataObject and deletes it from the underlying data source
 void deleteBatch(List valueObjectList)
          Updates an entire batch of DataObjects
 void deleteBatch(List valueObjectList, boolean deleteWithSetFieldsOnly)
          Updates an entire batch of DataObjects
 boolean retrieve(DataObject valueObject)
          Takes a DataObject and retrieves it from the underlying data source
 void runStoreProcedure(DataObject valueObject)
          Takes a DataObject and run it from the underlying data source
 void update(DataObject valueObject, boolean updateChangedFieldsOnly)
          Takes a DataObject and updates it to the underlying data source
 void updateAll(DataObject valueObject, boolean updateChangedCache)
          Takes a DataObject and updates it to the underlying data source
 void updateBatch(List valueObjectList)
          Updates an entire batch of DataObjects
 void updateBatch(List valueObjectList, boolean updateChangedFieldsOnly)
          Updates an entire batch of DataObjects
 

Method Detail

add

public void add(DataObject valueObject)
         throws DataException,
                DuplicateKeyException
Takes a DataObject and adds it to the underlying data source

Parameters:
valueObject - the DataObject to add.
Throws:
DataException - upon error adding the object to the data source
DuplicateKeyException - if the object already existed in the data source.

delete

public void delete(DataObject valueObject)
            throws DataException
Takes a DataObject and deletes it from the underlying data source

Parameters:
valueObject - the DataObject to delete.
Throws:
DataException - upon error deleting the object to the data source

update

public void update(DataObject valueObject,
                   boolean updateChangedFieldsOnly)
            throws DataException
Takes a DataObject and updates it to the underlying data source

Parameters:
valueObject - the DataObject to update.
updateChangedFieldsOnly - flag to signify if only fields whose value has changed should be included in the update.
Throws:
DataException - upon error updating the object to the data source

retrieve

public boolean retrieve(DataObject valueObject)
                 throws DataException
Takes a DataObject and retrieves it from the underlying data source

Parameters:
valueObject - the DataObject to add.
Returns:
true if the object was successfully found, false if no object found that represents the criteria specified
Throws:
DataException - upon error retriving the object from the data source

addBatch

public void addBatch(List valueObjectList)
              throws DataException,
                     DuplicateKeyException
Adds an entire batch of DataObjects to the underlying data source

Parameters:
valueObjectList - A list of DataObjects to add to the underlying data source
Throws:
DataException - upon error communicating with the underlying data source
DuplicateKeyException - if one of the records was already in the data source

deleteBatch

public void deleteBatch(List valueObjectList)
                 throws DataException
Updates an entire batch of DataObjects

Parameters:
valueObjectList - A list of DataObjects to update to the underlying data source
Throws:
DataException - upon error updating the data source

deleteBatch

public void deleteBatch(List valueObjectList,
                        boolean deleteWithSetFieldsOnly)
                 throws DataException
Updates an entire batch of DataObjects

Parameters:
valueObjectList - A list of DataObjects to update to the underlying data source
Throws:
DataException - upon error updating the data source

updateBatch

public void updateBatch(List valueObjectList)
                 throws DataException
Updates an entire batch of DataObjects

Parameters:
valueObjectList - A list of DataObjects to update to the underlying data source
Throws:
DataException - upon error updating the data source

updateBatch

public void updateBatch(List valueObjectList,
                        boolean updateChangedFieldsOnly)
                 throws DataException
Updates an entire batch of DataObjects

Parameters:
valueObjectList - A list of DataObjects to update to the underlying data source
updateChangedFieldsOnly - flag to signify if only fields whose value has changed should be included in the update.
Throws:
DataException - upon error updating the data source

updateAll

public void updateAll(DataObject valueObject,
                      boolean updateChangedCache)
               throws DataException
Takes a DataObject and updates it to the underlying data source

Parameters:
valueObject - the DataObject to update.
Throws:
DataException - upon error updating the object to the data source

deleteAll

public void deleteAll(DataObject valueObject,
                      boolean deleteChangedCache)
               throws DataException
Takes a DataObject and deletes it from the underlying data source

Parameters:
valueObject - the DataObject to delete.
Throws:
DataException - upon error deleting the objects to the data source

runStoreProcedure

public void runStoreProcedure(DataObject valueObject)
                       throws DataException
Takes a DataObject and run it from the underlying data source

Parameters:
valueObject - the DataObject to run.
Throws:
DataException - upon error retriving the object from the data source

Expresso 5-6

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