public final class CSBasketMultiple extends CSItemMultiple
The CSBasketMultiple
class provides a method that retrieves several baskets from the database. This
method requires that certain database and key information (basket group, for example) be specified via the
set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSBasketMultiple
class.
CSBasket
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSBasketMultiple()
Creates an empty
CSBasketMultiple object. |
CSBasketMultiple(java.lang.String strPropertyFile)
Creates a new
CSBasketMultiple , specifying a properties file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Removes several baskets from the database.
|
boolean |
exist()
Not currently implemented for
CSBasketMultiple . |
void |
get()
Retrieves the details of several baskets from the database.
|
java.lang.String |
getBasketGroup()
Gets the basket group specified as key information.
|
java.lang.String |
getBasketIDList()
Gets the list of basket IDs specified as key information.
|
void |
setBasketGroup(java.lang.String strBasketGroup)
Specifies the group of the basket for which its baskets are to be retrieved.
|
void |
setBasketIDList(java.lang.String strBasketIDList)
Specifies the IDs of the basket that are to be retrieved.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the baskets are to be retrieved.
|
void |
update()
Not currently implemented for
CSBasketMultiple . |
equals, getItems, getMaxRows, getSortOrder, getStartRow, iterator, setItems, setMaxRows, setStartRow, toString
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSBasketMultiple()
CSBasketMultiple
object.
Use the various set
methods provided to initialise the CSBasketMultiple
object
prior to invoking any of its query methods.
public CSBasketMultiple(java.lang.String strPropertyFile)
CSBasketMultiple
, specifying a properties file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSBasketMultiple
object prior to invoking
any of its query methods.
strPropertyFile
- the property file that contains the connection details.public java.lang.String getBasketIDList()
public void setBasketIDList(java.lang.String strBasketIDList)
setBasketIDList
followed by a call to get
returns details of all the specified
baskets.
strBasketIDList
- a comma-separated list of basket IDs.public java.lang.String getBasketGroup()
public void setBasketGroup(java.lang.String strBasketGroup)
setBasketGroup
followed by a call to get
returns details of all the baskets of the
specified basket group.
strBasketGroup
- the basket group.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for a basket are :
LEVEL_ID
Retrieves BasketID only.LEVEL_SUMMARY
Retrieves BasketID, BasketName and BasketGroup.LEVEL_DETAIL
Retrieves all basket data.LEVEL_ALL
Retrieves all basket data and its basket items.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if the setBasketIDList
key information is being
supplied. One or more of the available sort orders may be specified as a comma-delimited list. Use ASC or DESC to
indicate the direction of ordering for a sort order. For example, "BasketGroup DESC" would order in descending
order of basket group. The default sort order in this instance is 'BasketGroup ASC,BasketName ASC'.
Available sort orders are :
BasketId - order by the basket ID
BasketName - order by the basket name
BasketGroup - order by the basket group
CreatedDate - order by created date
LastUpdatedDate - order by last updated date
setSortOrder
in class CSItemMultiple
strSortOrderList
- a comma-separated list of one or more of the available sort orders.CSParameterException
- if an invalid sort order was specifiedpublic boolean exist() throws CSException
CSBasketMultiple
.
exist
in class CSItemMultiple
true
if all baskets exist on the database.CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSException
- the base class for exceptions thrown by this method.public void get() throws CSException
Use get
without any key information to populate this CSBasketMultiple
object with
the details of all the baskets from the database.
Use setBasketIDList
followed by get
to populate this
CSBasketMultiple
object with the details of the baskets specified in the list. The retrieved
baskets will appear within CSBasketMultiple
in the order that their IDs appear within the supplied
list. Key information set using setSortOrder
, setMaxRows
and setStartRow
is not valid in this instance.
Use setBasketGroup
followed by get
to populate this
CSBasketMultiple
object with the details of the baskets of the specified basket group.
Each retrieved basket is stored as a CSBasket
object within the item ArrayList
member of
CSBasketMultiple
- use getItems
or iterator
to
access/navigate through them. These baskets will be stored in the ArrayList
in the order specified
using the setSortOrder
method, or the default sort order of 'BasketGroup
ASC,BasketName ASC'. However, if a list of basket IDs was specified, the baskets are stored in the same order as
in the specified list.
get
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified baskets cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void update() throws CSException
CSBasketMultiple
.
update
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified baskets cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
Use setBasketIDList
followed by delete
to remove all baskets
whose IDs are listed, from the database.
Use setBasketGroup
followed by delete
to remove all basket items
for the specified basket group, from the database.
delete
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified baskets cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.