public final class CSOrderItemMultiple extends CSItemMultiple
The CSOrderItemMultiple
class provides a method that retrieves several order items from the database.
This method requires that certain database and key information (order ID, for example) be specified via the
set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSOrderItemMultiple
class.
CSOrderItem
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSOrderItemMultiple()
Creates an empty
CSOrderItemMultiple object. |
CSOrderItemMultiple(java.lang.String strPropertyFile)
Creates a new
CSOrderItemMultiple , specifying a properties file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Removes several order items from the database.
|
boolean |
exist()
Not currently implemented for
CSOrderItemMultiple . |
void |
get()
Retrieves the details of several order items from the database.
|
java.lang.Integer |
getDecimalPlaces()
Gets the decimal places setting to be applied to the product type's price.
|
int |
getOrderID()
Gets the order ID specified as key information.
|
java.lang.String |
getOrderItemIDList()
Gets the list of order item IDs specified as key information.
|
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 |
setOrderID(int nOrderID)
Specifies the ID of the order for which its order items are to be retrieved.
|
void |
setOrderItemIDList(java.lang.String strOrderItemIDList)
Specifies the IDs of the order items that are to be retrieved.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the order items are to be retrieved.
|
void |
update()
Updates the details of several order 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 CSOrderItemMultiple()
CSOrderItemMultiple
object.
Use the various set
methods provided to initialise the CSOrderItemMultiple
object
prior to invoking any of its query methods.
public CSOrderItemMultiple(java.lang.String strPropertyFile)
CSOrderItemMultiple
, specifying a properties file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSOrderItemMultiple
object prior to
invoking any of its query methods.
strPropertyFile
- the property file that contains the connection details.public java.lang.String getOrderItemIDList()
public void setOrderItemIDList(java.lang.String strOrderItemIDList)
setOrderItemIDList
followed by a call to get
returns details of all the specified
order items.
strOrderItemIDList
- a comma-separated list of order item IDs.public int getOrderID()
public void setOrderID(int nOrderID)
setOrderID
followed by a call to get
returns details of all the order items of the
specified order.
nOrderID
- the order ID.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 item are :
LEVEL_ID
Retrieves the OrderItemID.LEVEL_SUMMARY
Retrieves all order item data except UserDataSet.LEVEL_ALL
Retrieves all order item data and associated order item dispatches.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 setOrderItemIDList
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 'ORDERID ASC,LINENUMBER ASC'.
Available sort orders are :
OrderID - order by the order ID
LineNumber - order by the line number
StockCode - order by stock code
Description - order by the order item description
Quantity - order by the quantity
DiscountSchemeName - order by the discount scheme name
TaxSchemeName - order by the tax scheme name
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
CSOrderItemMultiple
.
exist
in class CSItemMultiple
true
if all order 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 setOrderItemIDList
followed by get
to populate this
CSOrderItemMultiple
object with the details of the order items specified in the list. The
retrieved order items will appear within CSOrderItemMultiple
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 setOrderID
followed by get
to populate this
CSOrderItemMultiple
object with the details of the order items of the specified order.
Each retrieved order item is stored as a CSOrderItem
object within the item ArrayList
member of CSOrderItemMultiple
- use getItems
or iterator
to access/navigate through them. These order items will be stored in the ArrayList
in the order
specified using the setSortOrder
method, or the default sort order of 'OrderID
ASC,LineNumber ASC'. However, if a list of order item IDs was specified, the order 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 order 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 order 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 order items cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
Use setOrderItemIDList
followed by delete
to remove all order
items whose IDs are listed, from the database.
Use setOrderID
followed by delete
to remove all order items for the
specified order, from the database.
When an order item is deleted any associated order item dispatches 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 order 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.