Class BindVisitor
- java.lang.Object
-
- org.linuxforhealth.fhir.database.utils.query.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.
-
-
-
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 interfaceBindMarkerNodeVisitor
-
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 interfaceBindMarkerNodeVisitor
-
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 interfaceBindMarkerNodeVisitor
-
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 interfaceBindMarkerNodeVisitor
-
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 interfaceBindMarkerNodeVisitor
-
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 interfaceBindMarkerNodeVisitor
-
-