© 2002 BEA Systems, Inc.


com.beasys.commerce.ebusiness.order
Class OrderAdjustmentPersistence

java.lang.Object
  |
  +--com.beasys.commerce.ebusiness.order.OrderAdjustmentPersistence

public class OrderAdjustmentPersistence
extends java.lang.Object

Create (persist) and Read Order Adjustments Order Adjustments are passed back as part of the Pricing Service Reply and are persisted as part of the Order (for now) persistence model.
It follows the pattern established by the CRUD objects in SmartBMP, ignoring Belonging issues which are not relevant here.
Persistence and reading is done using a connection object passed by the calling method.


Constructor Summary
OrderAdjustmentPersistence()
           
 
Method Summary
static long[] findOrderAdjustmentPK(java.sql.Connection connection, java.lang.String orderPk)
          Given an Order Identifier and a Connection, returns a array of order adjustment identifier.
static void insert(java.sql.Connection connection, long key, java.lang.String orderId, java.sql.Date creationDate, OrderAdjustment orderAdjustment)
          Insert one OrderAdjustment in the ORDER_ADJUSTMENT table, including the previously generated primary key.
static OrderAdjustmentPresentation query(java.sql.Connection connection, long key)
          Query from database one Order Adjustments, using the adjustment primary key information in the where clause.
static java.util.ArrayList retrieveOrderAdjustmentPresentations(java.sql.Connection connection, OrderPk orderPk)
          Retrieves all the OrderAdjustment into an ArrayList of OrderAdjustmentPresentation's.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderAdjustmentPersistence

public OrderAdjustmentPersistence()
Method Detail

insert

public static void insert(java.sql.Connection connection,
                          long key,
                          java.lang.String orderId,
                          java.sql.Date creationDate,
                          OrderAdjustment orderAdjustment)
                   throws BMPException
Insert one OrderAdjustment in the ORDER_ADJUSTMENT table, including the previously generated primary key.

Parameters:
connection - the database connection
key, - the key for the ORDER_ADJUSTMENT table
orderId, - the 'foreign' key to the WLCS_ORDER table
creationDate, - the date at which the order and its adjustments are persisted
the - Order Adjustment to be persisted

query

public static OrderAdjustmentPresentation query(java.sql.Connection connection,
                                                long key)
                                         throws BMPException
Query from database one Order Adjustments, using the adjustment primary key information in the where clause.

The role is not to query for all the adjustments, that is done in the calling method. Only one adjustmentPresentation is retrieved here, keeping this method clean.

Parameters:
connection - the database connection
key, - the primary key for the adjustment
Returns:
one OrderAdjustmentPresentation object, to be associated eventually with the orderValue.

findOrderAdjustmentPK

public static long[] findOrderAdjustmentPK(java.sql.Connection connection,
                                           java.lang.String orderPk)
                                    throws BMPException
Given an Order Identifier and a Connection, returns a array of order adjustment identifier. This can be in turn used to retrieve all OrderAdjustmentPresentation objects

It selects the PKs in order they were created

Parameters:
connection, - to connect to the Commerce DB
orderPk, - the PK for an order
Returns:
a long[] of PK, null if none is there.

retrieveOrderAdjustmentPresentations

public static java.util.ArrayList retrieveOrderAdjustmentPresentations(java.sql.Connection connection,
                                                                       OrderPk orderPk)
Retrieves all the OrderAdjustment into an ArrayList of OrderAdjustmentPresentation's. These may be then associated with an orderValue, and used by JSP's.

The returned value may be empty, but not null.

Parameters:
connection, - to connect to the Commerce DB
orderPk, - the PK for an order
Returns:
an ArrayList of all OrderAdjustmentPresentations objects

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved