Expresso 5-6

com.jcorporate.expresso.core.dataobjects
Interface DataQueryInterface

All Known Implementing Classes:
JDBCQuery

public interface DataQueryInterface

This interface provides a standard interface to deal with parts that operate and return multiple DataObjects. This is in an attempt to make a DataObject more focused than before. [ie to cut down on size] by separating operations on a single dbobject from operations on a multiple dbobject.

Since:
Expresso 5.0
Author:
Michael Rimov

Method Summary
 boolean find(DataObject criteria)
          Finds a single record based upon the criteria specified by the DataObject
 boolean find(DataTransferObject criteria)
          Finds a single record based upon the criteria specified by the DataTransferObject
 void release()
          Release the query and all connections/resources associated with the query.
 List searchAndRetrieve(DataObject criteria)
          Performs a datasource search so that the criteria set in the DataObject is used.
 List searchAndRetrieve(DataObject criteria, String sortOrder)
          Performs a datasource search so that the criteria set in the DataObject is used.
 List searchAndRetrieve(DataTransferObject criteria)
          Performs a datasource search so that the criteria set by a DataTransferObject is used.
 List searchAndRetrieve(DataTransferObject criteria, String sortOrder)
          Performs a datasource search so that the criteria set by a DataTransferObject is used.
 

Method Detail

searchAndRetrieve

public List searchAndRetrieve(DataObject criteria,
                              String sortOrder)
                       throws DataException
Performs a datasource search so that the criteria set in the DataObject is used.

Parameters:
criteria - a DataObject with the fields filled out so that all objects returned will match the fields specified in the DataObject
sortOrder - A pipe delimited string specifying the field(s) to be sorted upon. May be a single field without any pipes.
Returns:
java.util.List of objects. May be an empty list if no objects were found.
Throws:
DataException - upon error performing the search

searchAndRetrieve

public List searchAndRetrieve(DataObject criteria)
                       throws DataException
Performs a datasource search so that the criteria set in the DataObject is used. There is no specified sort order for this version of the method

Parameters:
criteria - a DataObject with the fields filled out so that all objects returned will match the fields specified in the DataObject
Returns:
java.util.List of objects. May be an empty list if no objects were found.
Throws:
DataException - upon error performing the search

searchAndRetrieve

public List searchAndRetrieve(DataTransferObject criteria)
                       throws DataException
Performs a datasource search so that the criteria set by a DataTransferObject is used. This is different from the DataObject search in that it is often meant to be used on remote machines where serializing lots of DataObjects is more expensive. Since a typical DataTransferObject is 1/2 the size of a DataObject, we significantly reduce network traffic by using this method at the expense of CPU time to translate the DataTransferObject back into a DataObject

Parameters:
criteria - a DataTransferObject with the fields filled out so that all objects returned will match the fields specified in the DataTransferObject
Returns:
java.util.List of DataTransferObject. May be an empty list if no objects were found.
Throws:
DataException - upon error performing the search

searchAndRetrieve

public List searchAndRetrieve(DataTransferObject criteria,
                              String sortOrder)
                       throws DataException
Performs a datasource search so that the criteria set by a DataTransferObject is used. This is different from the DataObject search in that it is often meant to be used on remote machines where serializing lots of DataObjects is more expensive. Since a typical DataTransferObject is 1/2 the size of a DataObject, we significantly reduce network traffic by using this method at the expense of CPU time to translate the DataTransferObject back into a DataObject

Parameters:
criteria - a DataTransferObject with the fields filled out so that all objects returned will match the fields specified in the DataTransferObject
sortOrder - A pipe delimited string specifying the field(s) to be sorted upon. May be a single field without any pipes.
Returns:
java.util.List of DataTransferObject. May be an empty list if no objects were found.
Throws:
DataException - upon error performing the search

find

public boolean find(DataObject criteria)
             throws DataException
Finds a single record based upon the criteria specified by the DataObject

Parameters:
criteria - a DataObject with the fields to match filled out.
Returns:
boolean true if a record was found, and the criteria parameter is filled with the first data object found.
Throws:
DataException - upon error performing the search

find

public boolean find(DataTransferObject criteria)
             throws DataException
Finds a single record based upon the criteria specified by the DataTransferObject

Parameters:
criteria - a DataTransferObject with the fields to match filled out.
Returns:
boolean true if a record was found, and the criteria parameter is filled with the first data object found.
Throws:
DataException - upon error performing the search

release

public void release()
Release the query and all connections/resources associated with the query.


Expresso 5-6

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