public final class CSOrderMultiple extends CSItemMultiple
The CSOrderMultiple
class provides a method that retrieves several orders 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 CSOrderMultiple
class.
CSOrder
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSOrderMultiple()
Creates an empty
CSOrderMultiple object. |
CSOrderMultiple(java.lang.String strPropertyFile)
Creates a new
CSOrderMultiple , specifying a properties file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Removes several orders from the database.
|
boolean |
exist()
Not currently implemented for
CSOrderMultiple . |
void |
get()
Retrieves the details of several orders from the database.
|
java.lang.String |
getBasketGroup()
Gets the basket group specified as key information.
|
java.lang.Integer |
getDecimalPlaces()
Gets the decimal places setting to be applied to the product type's price.
|
java.lang.String |
getOrderIDList()
Gets the list of order IDs specified as key information.
|
java.lang.String |
getStatusCodeList()
Gets the status codes specified as key information.
|
java.lang.String |
getStatusDescriptionList()
Gets the text used as key information on the order's status description.
|
void |
setBasketGroup(java.lang.String strBasketGroup)
Specifies the basket group for which its order items are to be retrieved.
|
void |
setDecimalPlaces(java.lang.Integer nDecimalPlaces)
Sets the decimal places setting to be applied to the product type's price.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setOrderIDList(java.lang.String strOrderIDList)
Specifies the IDs of the orders that are to be retrieved.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the orders are to be retrieved.
|
void |
setStatusCodeList(java.lang.String strStatusCodeList)
Specifies the status codes to be used as key information.
|
void |
setStatusDescriptionList(java.lang.String strStatusDescriptionList)
Specifies the status descriptions to be used as key information.
|
void |
update()
Updates the details of several orders 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 CSOrderMultiple()
CSOrderMultiple
object.
Use the various set
methods provided to initialise the CSOrderMultiple
object prior
to invoking any of its query methods.
public CSOrderMultiple(java.lang.String strPropertyFile)
CSOrderMultiple
, specifying a properties file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSOrderMultiple
object prior to invoking
any of its query methods.
strPropertyFile
- the property file that contains the connection details.public java.lang.String getOrderIDList()
public void setOrderIDList(java.lang.String strOrderIDList)
setOrderIDList
followed by a call to get
returns details of all the specified
orders.
strOrderIDList
- a comma-separated list of order 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 order items of
the specified basket group.
strBasketGroup
- the basket group.public java.lang.String getStatusCodeList()
Only orders with one of the specified status codes will be returned.
public void setStatusCodeList(java.lang.String strStatusCodeList)
Only orders with one of the specified status codes will be returned.
setStatusCodeList
in combination with any other key information followed by a call to
get
returns details of all the orders that match all the specified key information.
strStatusCodeList
- a comma-separated list of status codes.public java.lang.String getStatusDescriptionList()
Only orders with a status description containing, or matching, the specified text will be returned.
public void setStatusDescriptionList(java.lang.String strStatusDescriptionList)
Only orders with one of the specified status descriptions will be returned.
setStatusDescriptionList
in combination with any other key information followed by a call to
get
returns details of all the orders that match all the specified key information.
strStatusDescriptionList
- a comma-separated list of status descriptions.public java.lang.Integer getDecimalPlaces()
If set to null then the decimal places as defined in the iCM Commerce Settings will be used.
public void setDecimalPlaces(java.lang.Integer nDecimalPlaces)
If set to null then the decimal places as defined in the iCM Commerce Settings will be used.
nDecimalPlaces
- the decimal places setting.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for an order are :
LEVEL_ID
Retrieves the OrderID.LEVEL_DETAIL
Retrieves all order data and associated order address.LEVEL_ALL
Retrieves all order data and associated order address and order 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 setOrderIDList
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, "CompletedDate DESC" would order in descending
order of completion date. The default sort order in this instance is 'BASKETGROUP ASC,CREATEDDATE DESC'.
Available sort orders are :
OrderID - order by the order ID
BasketGroup - order by the basket group
CreatedDate - order by the creation date
CompletedDate - order by the completion date
StatusCode - order by the status code
StatusDescription - order by the status description
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
CSOrderMultiple
.
exist
in class CSItemMultiple
true
if all orders 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 CSOrderMultiple
object with
the details of all the orders from the database.
Use setOrderIDList
followed by get
to populate this
CSOrderMultiple
object with the details of the orders specified in the list. The retrieved orders
will appear within CSOrderMultiple
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
CSOrderMultiple
object with the details of the orders of the specified basket group.
Use setStatusCodeList
and
setStatusDescriptionList
to filter the orders to only retrieve those
that also match the specified status code and/or status description.
Each retrieved order is stored as a CSOrder
object within the item ArrayList
member of
CSOrderMultiple
- use getItems
or iterator
to
access/navigate through them. These orders will be stored in the ArrayList
in the order specified
using the setSortOrder
method, or the default sort order of 'BasketGroup
ASC,CreatedDate DESC'. However, if a list of order IDs was specified, the orders 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 orders 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 orders 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 orders cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
Use setOrderIDList
followed by delete
to remove all orders whose
IDs are listed, from the database.
Use setBasketGroup
followed by delete
to remove all orders for the
specified basket group, from the database.
When an order is deleted any associated order items, order item dispatches and order addresses will also be deleted.
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 orders cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.