com.ibm.commerce.foundation.server.services.dataaccess

Class NamedQueryParameters

  • java.lang.Object
    • com.ibm.commerce.foundation.server.services.dataaccess.NamedQueryParameters


  • public class NamedQueryParameters
    extends java.lang.Object
    This class represents parameters for a query template for named SQL queries executed using the JDBCQueryService class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addParameter(java.lang.String astrParameterName, java.util.List alstrParameterValues)
      Sets a list of values for a given parameter.
      void addParameter(java.lang.String astrParameterName, java.lang.String astrParameterValue)
      Add a new parameter and its value.
      java.lang.Long getOptimisticConcurrencyCounterValue()
      Get the value of the the optimistic concurrency counter.
      java.util.List getParameterValues(java.lang.String astrParameterName)
      Return a list of values for a given parameter.
      java.util.Map getQueryParameters()
      Get a collection of query parameters.
      boolean isOptimisticConcurrencyCounterValueNull()
      Check if the optimistic concurrency counter value is NULL.
      void setOptimisticConcurrencyCounterValue(java.lang.Long anOptimisticConcurrencyCounter)
      Sets the value of the optimistic concurrency counter that is typically used by the UPDATE queries.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NamedQueryParameters

        public NamedQueryParameters()
    • Method Detail

      • addParameter

        public void addParameter(java.lang.String astrParameterName,
                                 java.lang.String astrParameterValue)
        Add a new parameter and its value. This method can be called multiple times for the same parameter. In this case, a parameter will have more than one value associated with it. Multiple values are specified for a query templates that use the SQL 'IN' clause. For example, UPDATE CATENTRY SET FIELD1=1 WHERE CATENTRY_ID IN (1001, 1002, 1003)
        Parameters:
        astrParameterName - - parameter name
        astrParameterValue - - parameter value
      • addParameter

        public void addParameter(java.lang.String astrParameterName,
                                 java.util.List alstrParameterValues)
        Sets a list of values for a given parameter. This method replaces an existing list (as opposed to the other method which adds to the existing list).
        Parameters:
        astrParameterName - - parameter name
        alstrParameterValues - - list of parameter values; multiple values are specified for queries that use the SQL 'IN' clause. Objects in the list are of type String
      • getParameterValues

        public java.util.List getParameterValues(java.lang.String astrParameterName)
        Return a list of values for a given parameter. The caller should not modify the returned list.
        Parameters:
        astrParameterName - - name of the query parameter
        Returns:
        list of values for the specified query parameter; the objects in the list are of type String. null is returned if specified parameter does not exist.
      • setOptimisticConcurrencyCounterValue

        public void setOptimisticConcurrencyCounterValue(java.lang.Long anOptimisticConcurrencyCounter)
        Sets the value of the optimistic concurrency counter that is typically used by the UPDATE queries.
        Parameters:
        anOptimisticConcurrencyCounter - - optimistic concurrency counter
      • getOptimisticConcurrencyCounterValue

        public java.lang.Long getOptimisticConcurrencyCounterValue()
        Get the value of the the optimistic concurrency counter.
        Returns:
        optimistic concurrency counter.
      • getQueryParameters

        public java.util.Map getQueryParameters()
        Get a collection of query parameters.
        Returns:
        A map contains the parameter name key as hasmap key and a list of values. The list may have mutliple entries for queries parameters used in the SQL 'IN' clause. Objects in the list are of type String
      • isOptimisticConcurrencyCounterValueNull

        public boolean isOptimisticConcurrencyCounterValueNull()
        Check if the optimistic concurrency counter value is NULL.
        Returns:
        true - if occ is null; false, otherwise.