public class CollateralSearchListDataBean
extends com.ibm.commerce.tools.util.CommonSearchHelperBean
com.ibm.commerce.tools.util.CommonSearchHelperBean
to support the
database side execution, the most important methods that would be necessary are the
ones to contruct the database query and the list of data beans. Methods are also
provided to get a list of entries that have been found and get a specific entry that
has been found. Extend this class with extra getters and setters to add extra search
criteria.
To make use of com.ibm.commerce.tools.util.CommonSearchHelperBean
class,
a query must first be created that will return the desired results from the database.
Some hints as to how this is done can be taken from looking at the current enterprise
beans and discovering what tables and contraints they currently use to retrieve the
desired data. Any parameters that are to be passed to the query such as ordering
information or search criteria must be received before the execution of the query.
Some of these parameters will have been set through the search or list data bean's
constructor. They can also be set by calling set methods in the JSP.
com.ibm.commerce.tools.util.CommonSearchHelperBean
provides a method to
execute the SQL statement. It sets up a cursor and an instance of a JDBC helper class
com.ibm.commerce.base.objects.ServerJDBCHelperBean
, and passes the
cursor and the returned SQL string (built in the buildQuery
method
implemented in this class) to the
com.ibm.commerce.base.objects.ServerJDBCHelperBean
instance. The
result size is then set, taken from the cursor. With the use of cursor, high volumes
of returned results can be divided into separate segments, and be displayed onto an
appropriate number of pages.
The buildResultDataBean
method must also be implemented. This method would
need to get the results from the returned vector and parse each row into the set methods
of a data bean. One would need to either create or augment an existing data bean to
allow parameters to be set in the data bean.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
CollateralSearchListDataBean()
The default constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
buildQuery()
This method constructs the SQL query.
|
void |
buildResultDataBean(java.util.Vector resultVector)
This method constructs the list of result data beans.
|
CollateralSearchDataBean[] |
getCollateralList()
This method returns the list of data beans found from the search or list,
represented by an array of
CollateralSearchDataBean objects. |
CollateralSearchDataBean |
getCollateralListData(int index)
This method returns the specific data bean at the passed index within the array of
data beans returned, represented by the
CollateralSearchDataBean
object. |
java.lang.String |
getCollateralName()
This method returns the name of the collateral to be searched for, this is the value
of the name criteria.
|
java.lang.String |
getCollateralNameType()
This method returns the type of search that is being performed to the collateral
name criteria.
|
void |
setCollateralList(java.util.Vector newCollateralList)
This method sets the list of data beans found from the search or list, represented
by an array of
CollateralSearchDataBean objects. |
void |
setCollateralName(java.lang.String newCollateralName)
This method sets the name of the collateral to be searched for, this is the value of
the name criteria.
|
void |
setCollateralNameType(java.lang.String newCollateralNameType)
This method sets the type of search that is being performed to the collateral name
criteria.
|
escapeSQLstring, getDefaultLanguageId, getIndexBegin, getIndexEnd, getLanguageId, getListSize, getResultList, getResultSetSize, getStoreId, getStoreIds, getStoreIdsInEntityType, getStoreRelType, getUpperCaseFunction, getUseCursor, populate, setIndexBegin, setIndexEnd, setLanguageId, setResultList, setResultSetSize, setStoreId, setStoreIds, setStoreIdsInEntityType, setStoreRelType, setUseCursor
fulfills, getCommandContext, getHttpRequest, getHttpResponse, getResources, getViewCommandContext, setCommandContext, setHttpRequest, setHttpResponse, setViewCommandContext
getRequestProperties, setRequestProperties
public static final java.lang.String COPYRIGHT
public CollateralSearchListDataBean()
public java.lang.String buildQuery() throws java.lang.Exception
buildQuery
abstract method in
com.ibm.commerce.tools.util.CommonSearchHelperBean
and be called by the
populate
method found in the same abstract class.buildQuery
in class com.ibm.commerce.tools.util.CommonSearchHelperBean
java.lang.Exception
- Thrown when an exception is encountered when constructing the
query.public void buildResultDataBean(java.util.Vector resultVector)
populate
method found in the
com.ibm.commerce.tools.util.CommonSearchHelperBean
.buildResultDataBean
in class com.ibm.commerce.tools.util.CommonSearchHelperBean
resultVector
- The result vector returned from the query execution.public CollateralSearchDataBean[] getCollateralList()
CollateralSearchDataBean
objects. These
are data beans that each hold data about a returned row. Each row returned has its
own data bean.public CollateralSearchDataBean getCollateralListData(int index) throws java.lang.ArrayIndexOutOfBoundsException
CollateralSearchDataBean
object. If the index is larger than the size of the array, an
ArrayIndexOutOfBoundsException
will be thrown.index
- The index of the result array.CollateralSearchDataBean
object.java.lang.ArrayIndexOutOfBoundsException
- Thrown when accessing an array with an out
of bound index.public java.lang.String getCollateralName()
public java.lang.String getCollateralNameType()
public void setCollateralList(java.util.Vector newCollateralList)
CollateralSearchDataBean
objects. These are data beans
that each hold data about a returned row. Each row returned has its own data bean.newCollateralList
- The list of collateral data beans.public void setCollateralName(java.lang.String newCollateralName)
newCollateralName
- The collateral name in the name criteria.public void setCollateralNameType(java.lang.String newCollateralNameType)
newCollateralNameType
- The type of search on the collateral name criteria.