com.ibm.commerce.tools.optools.order.helpers
Class OrderSearchAccessBean

java.lang.Object
  |
  +--com.ibm.ivj.ejb.runtime.AbstractAccessBean
        |
        +--com.ibm.ivj.ejb.runtime.AbstractSessionAccessBean
              |
              +--com.ibm.commerce.tools.optools.order.helpers.OrderSearchAccessBean
All Implemented Interfaces:
java.io.Serializable

public class OrderSearchAccessBean
extends com.ibm.ivj.ejb.runtime.AbstractSessionAccessBean

This bean provides finder methods to retrieve a list of order IDs based on the input parameters

See Also:
Serialized Form

Fields inherited from class com.ibm.ivj.ejb.runtime.AbstractAccessBean
DEFAULT_NAMESERVICE_PROVIDER_URL, DEFAULT_NAMESERVICE_TYPE, ejbRef
 
Constructor Summary
OrderSearchAccessBean()
          Default constructor.
OrderSearchAccessBean(javax.ejb.EJBObject object)
          Creates an access bean for the specified EJB.
 
Method Summary
 com.ibm.commerce.tools.optools.common.helpers.DynamicListData findOrderAccountIDsForCustomer(java.lang.String userId)
          This methods retrieves all account ids that the user or the user's organization holds.
 com.ibm.commerce.tools.optools.common.helpers.DynamicListData findOrdersForStore(java.lang.Long storeId, java.lang.String orderBy, java.lang.String orderId, java.lang.String userLogin, java.lang.String userId, java.lang.String orderStatus, java.lang.String organizationId, java.lang.Integer startIndex, java.lang.Integer maxLength)
          This methods retrieves the IDs of the orders in the store specified by the storeId.
 
Methods inherited from class com.ibm.ivj.ejb.runtime.AbstractAccessBean
defaultJNDIName, defaultNameServiceType, defaultNameServiceURL, getEJBRef, getGlobalHome, getHome, getInit_GlobalNameServiceTypeName, getInit_GlobalNameServiceURLName, getInit_JNDIName, getInit_NameServiceTypeName, getInit_NameServiceURLName, getInitContext, getInitContext, instantiateEJB, resetEJBRef, resetHomeCache, setEJBRef, setInit_GlobalNameServiceTypeName, setInit_GlobalNameServiceURLName, setInit_JNDIName, setInit_NameServiceTypeName, setInit_NameServiceURLName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderSearchAccessBean

public OrderSearchAccessBean()

Default constructor. Maps to findByPrimaryKey.


OrderSearchAccessBean

public OrderSearchAccessBean(javax.ejb.EJBObject object)
                      throws java.rmi.RemoteException

Creates an access bean for the specified EJB.

Parameters:
object - The EJB Object used for the access bean construction.
Throws:
java.rmi.RemoteException - The java.rmi.RemoteException exception
Method Detail

findOrderAccountIDsForCustomer

public com.ibm.commerce.tools.optools.common.helpers.DynamicListData findOrderAccountIDsForCustomer(java.lang.String userId)
                                                                                             throws javax.naming.NamingException,
                                                                                                    java.sql.SQLException,
                                                                                                    java.rmi.RemoteException,
                                                                                                    javax.ejb.ObjectNotFoundException,
                                                                                                    javax.ejb.CreateException

This methods retrieves all account ids that the user or the user's organization holds.

SELECT TRADING_ID FROM PARTICIPNT WHERE MEMBER_ID = ? AND PARTROLE_ID = 5
SELECT TRADING_ID FROM PARTICIPNT, MBRREL WHERE PARTROLE_ID = 5 AND DESCENDANT_ID = ? AND ANCESTOR_ID = MEMBER_ID AND SEQUENCE IN (SELECT MAX(SEQUENCE) FROM MBRREL WHERE DESCENDANT_ID = ? AND ANCESTOR_ID NOT IN (-2001))

Parameters:
userId - The ID of user
Returns:
com.ibm.commerce.tools.optools.common.helpers.DynamicListData
Throws:
javax.naming.NamingException - The javax.naming.NamingException exception
java.sql.SQLException - The java.sql.SQLException exception
java.rmi.RemoteException - The java.rmi.RemoteException exception
javax.ejb.ObjectNotFoundException - The javax.ejb.ObjectNotFoundException exception
javax.ejb.CreateException - The javax.ejb.CreateException exception

findOrdersForStore

public com.ibm.commerce.tools.optools.common.helpers.DynamicListData findOrdersForStore(java.lang.Long storeId,
                                                                                        java.lang.String orderBy,
                                                                                        java.lang.String orderId,
                                                                                        java.lang.String userLogin,
                                                                                        java.lang.String userId,
                                                                                        java.lang.String orderStatus,
                                                                                        java.lang.String organizationId,
                                                                                        java.lang.Integer startIndex,
                                                                                        java.lang.Integer maxLength)
                                                                                 throws javax.naming.NamingException,
                                                                                        java.sql.SQLException,
                                                                                        java.rmi.RemoteException,
                                                                                        javax.ejb.ObjectNotFoundException,
                                                                                        javax.ejb.CreateException

This methods retrieves the IDs of the orders in the store specified by the storeId. Optional parameters can be passed in to narrow the search. A startIndex and maxLength are required to limit the number of the order IDs to be returned.

SELECT ORDERS_ID, LOGONID, TIMEPLACED, LASTUPDATE, TOTALPRODUCT+TOTALADJUSTMENT+TOTALSHIPPING+TOTALTAX+TOTALTAXSHIPPING AS TOTAL FROM ORDERS LEFT OUTER JOIN USERREG ON MEMBER_ID=USERS_ID

WHERE STOREENT_ID=? AND ORDERS_ID IN (?) AND ORDERS.STATUS IN (?) AND ORDERS.MEMBER_ID IN (?) AND (LOGONID LIKE ? ESCAPE '\\') AND ORDERS.ORGENTITY_ID IN (SELECT DESCENDANT_ID FROM MBRREL, ORGENTITY WHERE MBRREL.DESCENDANT_ID = ORGENTITY.ORGENTITY_ID AND ((ANCESTOR_ID = ? AND ORGENTITY.ORGENTITYTYPE = 'OU') OR ORGENTITY.ORGENTITY_ID = ?)) ORDER BY ?

The possible values for orderStatus are:

The possible values for orderBy are:

Parameters:
storeId - The ID of the store
orderBy - (Optional) The orderby column of the search result
orderId - (Optional) The ID of the order
userLogin - (Optional) The login name of the user
userId - (Optional) The ID of the user
orderStatus - (Optional) The status of the orders
organizationId - (Optional) The ID of the organization who submit the orders. This is only used in B2B store.
startIndex - The starting index of the result set that will be fetched.
maxLength - The maximum number rows returns starting from the startIndex of the resultset.
Returns:
com.ibm.commerce.tools.optools.common.helpers.DynamicListData
Throws:
javax.naming.NamingException - The javax.naming.NamingException exception
java.sql.SQLException - The java.sql.SQLException exception
java.rmi.RemoteException - The java.rmi.RemoteException exception
javax.ejb.ObjectNotFoundException - The javax.ejb.ObjectNotFoundException exception
javax.ejb.CreateException - The javax.ejb.CreateException exception