Class BindVisitor

  • All Implemented Interfaces:
    BindMarkerNodeVisitor

    public class BindVisitor
    extends java.lang.Object
    implements BindMarkerNodeVisitor
    Visitor implementation to bind (set) values for a PreparedStatement.
    The bindXX methods translate any SQLException to a DataAccessException which is unchecked - this avoids polluting callers with SQLException for looser coupling.
    • Constructor Summary

      Constructors 
      Constructor Description
      BindVisitor​(java.sql.PreparedStatement ps, IDatabaseTranslator translator)
      Public constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bindBigDecimal​(java.math.BigDecimal value)
      Bind the given value for the idx'th parameter.
      void bindDouble​(java.lang.Double value)
      Bind the given value for the idx'th parameter.
      void bindInstant​(java.time.Instant value)
      Bind the given value for the idx'th parameter.
      void bindInt​(java.lang.Integer value)
      Bind the given value for the idx'th parameter.
      void bindLong​(java.lang.Long value)
      Bind the given value for the idx'th parameter.
      void bindString​(java.lang.String value)
      Bind the given value for the idx'th parameter.
      • Methods inherited from class java.lang.Object

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

      • BindVisitor

        public BindVisitor​(java.sql.PreparedStatement ps,
                           IDatabaseTranslator translator)
        Public constructor
        Parameters:
        ps -
        translator -
    • Method Detail

      • bindString

        public void bindString​(java.lang.String value)
        Description copied from interface: BindMarkerNodeVisitor
        Bind the given value for the idx'th parameter. The idx value starts at 1, matching the semantics of the PreparedStatement setXX API.
        Specified by:
        bindString in interface BindMarkerNodeVisitor
      • bindLong

        public void bindLong​(java.lang.Long value)
        Description copied from interface: BindMarkerNodeVisitor
        Bind the given value for the idx'th parameter. The idx value starts at 1, matching the semantics of the PreparedStatement setXX API.
        Specified by:
        bindLong in interface BindMarkerNodeVisitor
      • bindInt

        public void bindInt​(java.lang.Integer value)
        Description copied from interface: BindMarkerNodeVisitor
        Bind the given value for the idx'th parameter. The idx value starts at 1, matching the semantics of the PreparedStatement setXX API.
        Specified by:
        bindInt in interface BindMarkerNodeVisitor
      • bindInstant

        public void bindInstant​(java.time.Instant value)
        Description copied from interface: BindMarkerNodeVisitor
        Bind the given value for the idx'th parameter. The idx value starts at 1, matching the semantics of the PreparedStatement setXX API.
        Specified by:
        bindInstant in interface BindMarkerNodeVisitor
      • bindDouble

        public void bindDouble​(java.lang.Double value)
        Description copied from interface: BindMarkerNodeVisitor
        Bind the given value for the idx'th parameter. The idx value starts at 1, matching the semantics of the PreparedStatement setXX API.
        Specified by:
        bindDouble in interface BindMarkerNodeVisitor
      • bindBigDecimal

        public void bindBigDecimal​(java.math.BigDecimal value)
        Description copied from interface: BindMarkerNodeVisitor
        Bind the given value for the idx'th parameter. The idx value starts at 1, matching the semantics of the PreparedStatement setXX API.
        Specified by:
        bindBigDecimal in interface BindMarkerNodeVisitor