public final class CSOrderAddress extends CSItem
The CSOrderAddress
class includes methods for the retrieval of a particular order address's details.
All such methods require that certain database and key information (order addressID, for example) be specified via
the set
methods provided, prior to their invocation.
All database access/connectivity is handled internally by the CSOrderAddress
class.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADDRESS_TYPE_DELIVERY
A valid value that can be used to set the address type for this order address.
|
static java.lang.String |
ADDRESS_TYPE_INVOICE
A valid value that can be used to set the address type for this order address.
|
ACCESS_GRANTED, DOES_NOT_EXIST, EMPTY, EXISTS, SECURE_ACCESS_DENIED, SECURE_ACCESS_GRANTED, UPDATE_ACTION_INSERTED, UPDATE_ACTION_UPDATED
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSOrderAddress()
Creates an empty
CSOrderAddress object. |
CSOrderAddress(CSOrderAddress objItem)
Creates an empty
CSOrderAddress object, and initialises it from the contents of the supplied
CSItem object. |
CSOrderAddress(java.lang.String strPropertyFile)
Creates a new
CSOrderAddress , specifying a property file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Removes the order address from the database.
|
boolean |
exist()
Determines whether an order address exists on the database.
|
void |
get()
Retrieves the details of an order address from the database.
|
java.lang.String |
getAddressType()
Gets the address type of the order address to be used as key information.
|
java.lang.String |
getCity()
Gets the city of the order address.
|
java.lang.String |
getCountry()
Gets the country of the order address.
|
java.lang.String |
getLine1()
Gets the first line of the order address.
|
java.lang.String |
getLine2()
Gets the second line of the order address.
|
java.lang.String |
getLine3()
Gets the third line of the order address.
|
java.lang.String |
getName()
Gets the name of the order address.
|
int |
getOrderAddressID()
Gets the ID of the order address to be used as key information.
|
int |
getOrderID()
Gets the ID of the order associated with the order address to be used as key information.
|
java.lang.String |
getPostalCode()
Gets the postal code of the order address.
|
java.lang.String |
getRegion()
Gets the region of the order address.
|
void |
setAddressType(java.lang.String strAddressType)
Sets the address type of the order address to be used as key information.
|
void |
setCity(java.lang.String strCity)
Sets the city of the order address.
|
void |
setCountry(java.lang.String strCountry)
Sets the country of the order address.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setLine1(java.lang.String strLine1)
Sets the first line of the order address.
|
void |
setLine2(java.lang.String strLine2)
Sets the second line of the order address.
|
void |
setLine3(java.lang.String strLine3)
Sets the third line of the order address.
|
void |
setName(java.lang.String strName)
Sets the name of the order address.
|
void |
setOrderAddressID(int nOrderAddressID)
Sets the order address ID to be used as key information.
|
void |
setOrderID(int nOrderID)
Sets the ID of the order associated with the order address to be used as key information.
|
void |
setPostalCode(java.lang.String strPostalCode)
Sets the postal code of the order address.
|
void |
setRegion(java.lang.String strRegion)
Sets the region of the order address.
|
void |
update()
Updates the details of an order address from the database, or inserts a new order address if no order address ID
has been specified and a matching order address cannot be found.
|
equals, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, toString, unset
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public static final java.lang.String ADDRESS_TYPE_DELIVERY
ADDRESS_TYPE_DELIVERY
indicates that this order address is a delivery order address.public static final java.lang.String ADDRESS_TYPE_INVOICE
ADDRESS_TYPE_INVOICE
indicates that this order address is an invoice order address.public CSOrderAddress()
CSOrderAddress
object.
Use the various set methods provided to initialise the CSOrderAddress
object prior to invoking any
of its query methods.
public CSOrderAddress(CSOrderAddress objItem)
CSOrderAddress
object, and initialises it from the contents of the supplied
CSItem object.
objItem
- the CSOrderAddress
object to be used to initialise the new onepublic CSOrderAddress(java.lang.String strPropertyFile)
CSOrderAddress
, specifying a property file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSOrderAddress
object prior to invoking any
of its query methods.
strPropertyFile
- the property file that contains the connection details.public int getOrderAddressID()
public void setOrderAddressID(int nOrderAddressID)
setOrderAddressID
followed by a call to get
will return details of the order
address with the specified ID.
nOrderAddressID
- the order address ID to be used as key information.public int getOrderID()
public void setOrderID(int nOrderID)
setOrderID
followed by a call to setAddressType
and
get
will return details of the order address associated with the specified order ID and address
type.
nOrderID
- the order address's associated order ID to be used as key information.public java.lang.String getAddressType()
public void setAddressType(java.lang.String strAddressType) throws CSParameterException
The valid address types are as follows :
DELIVERY
INVOICE
setAddressType
followed by a call to setOrderID
and get
will return details of the order address associated with the specified address type and order ID.
strAddressType
- the order address's address type to be used as key information.CSParameterException
- if an invalid address type is specified.public java.lang.String getName()
public void setName(java.lang.String strName)
strName
- the order address's name.public java.lang.String getLine1()
public void setLine1(java.lang.String strLine1)
strLine1
- the order address's first line.public java.lang.String getLine2()
public void setLine2(java.lang.String strLine2)
strLine2
- the order address's second line.public java.lang.String getLine3()
public void setLine3(java.lang.String strLine3)
strLine3
- the order address's third line.public java.lang.String getCity()
public void setCity(java.lang.String strCity)
strCity
- the order address's city.public java.lang.String getRegion()
public void setRegion(java.lang.String strRegion)
strRegion
- the order address's region.public java.lang.String getPostalCode()
public void setPostalCode(java.lang.String strPostalCode)
strPostalCode
- the order address's postal code.public java.lang.String getCountry()
public void setCountry(java.lang.String strCountry)
strCountry
- the order address's country.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for an order address are :
LEVEL_ALL
Retrieves all order address data.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public boolean exist() throws CSException
Use setOrderAddressID
followed by exist
to ascertain if there is
an order address with the specified ID on the database.
Use setOrderID
in conjunction with setAddressType
followed by exist
to ascertain if there is an order address associated with the specified order ID
and address type on the database.
exist
in class CSItem
true
if this order address exists on the database.CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void get() throws CSException
If it is not necessary to retrieve all the details of the order address then specify the amount of detail
required using the setDetailLevel
method before calling this method.
Use setOrderAddressID
followed by get
to populate this
CSOrderAddress
object with the details of the order address identified by the specified ID.
Use setOrderID
in conjunction with setAddressType
followed by get
to populate this CSOrderAddress
object with the details of the
order address associated with the specified order ID and address type.
get
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified order address 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 setOrderAddressID
followed by update
to update the order
address identified by the specified ID with the specified name, first line, second line, third line, city,
region, postal code and country.
Use setOrderID
in conjunction with setAddressType
followed by update
to update the order address identified by the specified order ID and address
type with the specified name, first line, second line, third line, city, region, postal code and country. If the
order address does not already exist then a new order address will be inserted with the specified order ID,
address type, name, line1, line2, line3, city, region, postal code and country.
update
in class CSItem
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 address cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
Use setOrderAddressID
followed by delete
to remove the order
address identified by the specified ID from the database.
Use setOrderID
in conjunction with setAddressType
followed by delete
to remove the order address associated with the specified order ID and address
type.
delete
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified order address cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.