public class CartLineController extends JDBCObjectController<CartLine>
CartLine
class. Provides methods for
retrieving and persisting cart line table records in the database.Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
ivDBObjCls, ivFieldCount, ivFieldKeyAlt, ivFieldKeyPri, ivFieldResPfx, ivSyncLast, ivSyncType, ivTableName
ivHashCode, ivHashFlds, ivObjAttrs
Constructor and Description |
---|
CartLineController()
The constructor for the controller.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(CartLine obj)
THIS METHOD SHOULD ONLY BE INVOKED BY THE CART CLASS, otherwise the cache
of cart lines will be corrupted.
|
int |
add(CartLine obj,
boolean logdup)
THIS METHOD SHOULD ONLY BE INVOKED BY THE CART CLASS, otherwise the cache
of cart lines will be corrupted.
|
boolean |
delete(CartLine obj)
THIS METHOD SHOULD ONLY BE INVOKED BY THE CART CLASS, otherwise the cache
of cart lines will be corrupted.
|
boolean |
deleteCart(Cart cart)
Deletes all cart line records for a cart.
|
boolean |
deleteProduct(CartLine cartline)
Deletes all cart line records that match a cart line's cart id, product
and unit of measure.
|
java.util.ArrayList<CartLine> |
getCart(FlashServletContext ctx,
Cart cart)
Returns a collection of all cart lines for a cart.
|
private int |
getNextLineNumber(java.lang.String id)
Returns the next available line number for a cart id.
|
CartLine |
resultSetToObject(java.sql.ResultSet rs)
Returns a database object from the given SQL result set.
|
boolean |
update(CartLine obj)
THIS METHOD SHOULD ONLY BE INVOKED BY THE CART CLASS, otherwise the cache
of cart lines will be corrupted.
|
add, arrayToMap, arrayToMap, countAll, delete, deleteAll, dispose, equals, getAll, getConnection, getConnectionInfo, getController, getFieldNames, getFieldNamesForKey, getFieldNamesForUpdate, getFieldNulls, getFieldNullsForKey, getFieldNullsForUpdate, getFieldsForOrderBy, getFieldsForWhere, getFieldSize, getFieldTypes, getFieldTypesForKey, getFieldTypesForUpdate, getStatementForDelete, getStatementForGet, getStatementForGetAll, getStatementForInsert, getStatementForUpdate, getStatementKey, getStatementString, getTableName, hasFieldNamesForKey, hasFieldNamesForUpdate, isDuplicate, resultSetToArray, resultSetToMap, resultSetToMap, setConnectionInfo, setPSDeleteValues, setPSExistsValues, setPSInsertValues, setPSUpdateValues, setPSValue, update, valuesToObject
cloneMapAttributes, formatValue, formatValue, getHashFields, getMapArrayList, getMapAttributes, getMapBigDecimal, getMapBoolean, getMapDate, getMapDouble, getMapInteger, getMapLong, getMapMapped, getMapObject, getMapShort, getMapString, getMapString, getMapStringBuffer, getMapStringBuilder, getMapTime, getMapTimestamp, getMapVector, hashCode, setHashFields, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMapAttributes, setMapObject, setMapTime, setMapTimestamp, toStringArray
private static final long serialVersionUID
public CartLineController()
public boolean add(CartLine obj)
Adds a new record to the table associated with the controller. Assumes
that duplicates are always logged as an exception.
Overrides add
in JDBCObjectController
.
add
in class JDBCObjectController<CartLine>
obj
- (JDBCObject) The object for the record to be added.true
if the record added successfully,
otherwise false
.public int add(CartLine obj, boolean logdup)
Adds a new record to the table associated with the controller.
Overrides add
in JDBCObjectController
.
add
in class JDBCObjectController<CartLine>
obj
- (JDBCObject) The object for the record to be added.logdup
- (boolean) true
if duplicate errors are to be
logged as an exception, otherwise false
if not. When
duplicates are logged, the return value of 1 is never returned.public boolean delete(CartLine obj)
Deletes an existing record from the table associated with the controller.
Overrides delete
in JDBCObjectController
.
delete
in class JDBCObjectController<CartLine>
obj
- (JDBCObject) The object for the record to be deleted.true
if the record deleted successfully,
otherwise false
.public boolean update(CartLine obj)
Updates an existing record in the table associated with the controller.
Overrides update
in JDBCObjectController
.
update
in class JDBCObjectController<CartLine>
obj
- (JDBCObject) The object for the record to be updated.true
if the record updated successfully,
otherwise false
.public CartLine resultSetToObject(java.sql.ResultSet rs) throws java.sql.SQLException
resultSetToObject
in class JDBCObjectController<CartLine>
rs
- (ResultSet) The result set containing the database record
from which the new object is to be created.
Overrides resultSetToObject
in JDBCObjectController
.
This method assumes the result set includes a reference to the zproduct database view.
java.sql.SQLException
- - if an error occurs while processing the result
set.public boolean deleteCart(Cart cart)
NOTE: This method only deletes records from the database table. It
does not delete from a cart's cached collection of cart lines. To also
delete from the cart's cache, invoke one of the deleteCartLine
or
deleteCartLines
methods in Cart
.
cart
- (Cart) The cart containing the records to delete.true
if the cart lines successfully deleted,
otherwise false
.public boolean deleteProduct(CartLine cartline)
NOTE: This method only deletes records from the database table. It
does not delete from a cart's cached collection of cart lines. To also
delete from the cart's cache, invoke one of the deleteCartLine
or
deleteCartLines
methods in Cart
.
cartline
- (CartLine) The cart line containing the values for
the records to delete.true
if the cart lines successfully deleted,
otherwise false
.public java.util.ArrayList<CartLine> getCart(FlashServletContext ctx, Cart cart)
NOTE: This method returns all existing cart lines for a cart, including
cart lines that have products which are not in the current shopping user's
catalog. To retrieve cart lines that are valid for the user's catalog,
invoke one of the getCartLine
or getCartLines
methods in
Cart
.
ctx
- (FlashServletContext) The current servlet context.
Pass a null
if Xref information is not needed.cart
- (Cart) The cart for the desired cart lines.private int getNextLineNumber(java.lang.String id)
id
- (String) The cart id for the desired line number.