public final class CSBasketItemMultiple extends CSItemMultiple
The CSBasketItemMultiple
class provides a method that retrieves several basket items from the
database. This method requires that certain database and key information (basket ID, for example) be specified via
the set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSBasketItemMultiple
class.
CSBasketItem
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSBasketItemMultiple()
Creates an empty
CSBasketItemMultiple object. |
CSBasketItemMultiple(java.lang.String strPropertyFile)
Creates a new
CSBasketItemMultiple , specifying a properties file that contains all of the
database connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Removes several basket items from the database.
|
boolean |
exist()
Not currently implemented for
CSBasketItemMultiple . |
void |
get()
Retrieves the details of several basket items from the database.
|
java.lang.String |
getBasketGroup()
Gets the basket group specified as key information.
|
int |
getBasketID()
Gets the basket ID specified as key information.
|
java.lang.String |
getBasketItemIDList()
Gets the list of basket item IDs specified as key information.
|
java.lang.String |
getBasketName()
Gets the basket name specified as key information.
|
void |
setBasketGroup(java.lang.String strBasketGroup)
Specifies the group of the basket for which its basket items are to be retrieved.
|
void |
setBasketID(int nBasketID)
Specifies the ID of the basket for which its basket items are to be retrieved.
|
void |
setBasketItemIDList(java.lang.String strBasketItemIDList)
Specifies the IDs of the basket items that are to be retrieved.
|
void |
setBasketName(java.lang.String strBasketName)
Specifies the name of the basket for which its basket items 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 basket items are to be retrieved.
|
void |
update()
Updates the details of several basket items on the database.
|
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 CSBasketItemMultiple()
CSBasketItemMultiple
object.
Use the various set
methods provided to initialise the CSBasketItemMultiple
object
prior to invoking any of its query methods.
public CSBasketItemMultiple(java.lang.String strPropertyFile)
CSBasketItemMultiple
, specifying a properties file that contains all of the
database connection details.
Use the various set methods provided to initialise the CSBasketItemMultiple
object prior to
invoking any of its query methods.
strPropertyFile
- the property file that contains the connection details.public java.lang.String getBasketItemIDList()
public void setBasketItemIDList(java.lang.String strBasketItemIDList)
setBasketItemIDList
followed by a call to get
returns details of all the specified
basket items.
strBasketItemIDList
- a comma-separated list of basket item IDs.public int getBasketID()
public void setBasketID(int nBasketID)
setBasketID
followed by a call to get
returns details of all the basket items of
the specified basket.
nBasketID
- the basket ID.public java.lang.String getBasketName()
public void setBasketName(java.lang.String strBasketName)
setBasketName
followed by a call to get
returns details of all the basket items of
the specified basket name.
setBasketName
followed by calls to setBasketGroup
and
get
returns details of all the basket items of the specified basket name and group.
strBasketName
- the basket name.public java.lang.String getBasketGroup()
public void setBasketGroup(java.lang.String strBasketGroup)
setBasketGroup
followed by calls to setBasketName
and
get
returns details of all the basket items of the specified basket name and group.
strBasketGroup
- the basket group.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for a basket item are :
LEVEL_ID
Retrieves BasketItemID only.LEVEL_SUMMARY
Retrieves all basket item data except for the user data.LEVEL_ALL
Retrieves all basket item data.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 setBasketItemIDList
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, "ProductOptionID DESC" would order in
descending order of product option ID. The default sort order in this instance is 'BasketItemID ASC'.
Available sort orders are :
BasketItemID - order by the basket item ID
BasketID - order by the basket ID
ProductOptionID - order by product option ID
DiscountSchemeID - order by the discount scheme ID
RackID - order by the rack ID
Quantity - order by the quantity
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
CSBasketItemMultiple
.
exist
in class CSItemMultiple
true
if all basket items 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 setBasketItemIDList
followed by get
to populate this
CSBasketItemMultiple
object with the details of the basket items specified in the list. The
retrieved basket items will appear within CSBasketItemMultiple
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 setBasketID
followed by get
to populate this
CSBasketItemMultiple
object with the details of the basket items of the specified basket.
Use setBasketName
followed by get
to populate this
CSBasketItemMultiple
object with the details of the basket items of the specified basket name.
Use setBasketName
followed by setBasketGroup
and
get
to populate this CSBasketItemMultiple
object with the details of the basket
items of the specified basket name and group.
Each retrieved basket item is stored as a CSBasketItem
object within the item ArrayList
member of CSBasketItemMultiple
- use getItems
or iterator
to access/navigate through them. These basket items will be stored in the ArrayList
in the order
specified using the setSortOrder
method, or the default sort order of 'BasketItemID
ASC'. However, if a list of basket item IDs was specified, the basket items 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 basket items 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
Use setItems
followed by update
to save the supplied basket items to
the database.
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 basket items cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
Use setBasketItemIDList
followed by delete
to remove all
basket items whose IDs are listed, from the database.
Use setBasketID
followed by delete
to remove all basket items for the
specified basket, from the database.
Use setBasketName
followed by delete
to remove all basket items for
the specified basket name, from the database.
Use setBasketName
followed by setBasketGroup
and
delete
to remove all basket items for the specified basket name and 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 basket items cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.