Expresso 5-6

com.jcorporate.expresso.core.dataobjects.jdbc
Class JDBCQuery

java.lang.Object
  extended bycom.jcorporate.expresso.core.dataobjects.jdbc.JDBCQuery
All Implemented Interfaces:
DataQueryInterface

public class JDBCQuery
extends Object
implements DataQueryInterface

Author:
Michael Rimov

Constructor Summary
JDBCQuery()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCQuery

public JDBCQuery()
Method Detail

searchAndRetrieve

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

Specified by:
searchAndRetrieve in interface DataQueryInterface
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
Description copied from interface: DataQueryInterface
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

Specified by:
searchAndRetrieve in interface DataQueryInterface
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
Description copied from interface: DataQueryInterface
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

Specified by:
searchAndRetrieve in interface DataQueryInterface
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
Description copied from interface: DataQueryInterface
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

Specified by:
searchAndRetrieve in interface DataQueryInterface
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
Description copied from interface: DataQueryInterface
Finds a single record based upon the criteria specified by the DataObject

Specified by:
find in interface DataQueryInterface
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
Description copied from interface: DataQueryInterface
Finds a single record based upon the criteria specified by the DataTransferObject

Specified by:
find in interface DataQueryInterface
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.

Specified by:
release in interface DataQueryInterface

Expresso 5-6

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