public abstract class AbstractQueryBindings<T extends BindValue> extends java.lang.Object implements QueryBindings<T>
| Modifier and Type | Field and Description |
|---|---|
protected T[] |
bindValues
Bind values for individual fields
|
protected java.lang.String |
charEncoding |
protected ColumnDefinition |
columnDefinition |
protected static java.time.LocalDate |
DEFAULT_DATE |
protected static java.time.LocalTime |
DEFAULT_TIME |
protected static byte[] |
HEX_DIGITS |
protected boolean |
isLoadDataQuery
Is this query a LOAD DATA query?
|
protected int |
numberOfExecutions |
protected RuntimeProperty<java.lang.Boolean> |
preserveInstants |
protected RuntimeProperty<java.lang.Boolean> |
sendFractionalSeconds |
protected RuntimeProperty<java.lang.Boolean> |
sendFractionalSecondsForTime |
protected Session |
session |
protected RuntimeProperty<java.lang.Boolean> |
useStreamLengthsInPrepStmts |
| Constructor and Description |
|---|
AbstractQueryBindings(int parameterCount,
Session sess) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkAllParametersSet() |
abstract void |
checkParameterSet(int columnIndex) |
boolean |
clearBindValues() |
abstract AbstractQueryBindings<T> |
clone() |
T[] |
getBindValues() |
byte[] |
getBytesRepresentation(int parameterIndex) |
int |
getNumberOfExecutions() |
byte[] |
getOrigBytes(int parameterIndex) |
void |
hexEscapeBlock(byte[] buf,
NativePacketPayload packet,
int size)
Used to escape binary data with hex for mb charsets
|
protected abstract void |
initBindValues(int parameterCount) |
boolean |
isLoadDataQuery() |
boolean |
isNull(int parameterIndex) |
void |
setBindValues(T[] bindValues) |
void |
setColumnDefinition(ColumnDefinition colDef) |
void |
setLoadDataQuery(boolean isLoadDataQuery) |
void |
setNumberOfExecutions(int numberOfExecutions) |
void |
setObject(int parameterIndex,
java.lang.Object parameterObj) |
void |
setObject(int parameterIndex,
java.lang.Object parameterObj,
MysqlType targetMysqlType) |
void |
setObject(int parameterIndex,
java.lang.Object parameterObj,
MysqlType targetMysqlType,
int scaleOrLength)
Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.
|
void |
setOrigValue(int paramIndex,
byte[] val) |
protected void |
setSerializableObject(int parameterIndex,
java.lang.Object parameterObj)
Sets the value for the placeholder as a serialized Java object (used by various forms of setObject()
|
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar targetCalendar,
int fractionalLength,
MysqlType targetMysqlType) |
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal,
MysqlType targetMysqlType) |
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
MysqlType targetMysqlType) |
void |
setValue(int paramIndex,
byte[] val,
MysqlType type) |
void |
setValue(int paramIndex,
java.lang.String val,
MysqlType type) |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbindTimestamp, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBigInteger, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setBytes, setBytesNoEscape, setBytesNoEscapeNoQuotes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLocalDate, setLocalDateTime, setLocalTime, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setShort, setString, setTime, setTimeprotected static final byte[] HEX_DIGITS
protected static final java.time.LocalDate DEFAULT_DATE
protected static final java.time.LocalTime DEFAULT_TIME
protected Session session
protected java.lang.String charEncoding
protected int numberOfExecutions
protected RuntimeProperty<java.lang.Boolean> useStreamLengthsInPrepStmts
protected RuntimeProperty<java.lang.Boolean> preserveInstants
protected RuntimeProperty<java.lang.Boolean> sendFractionalSeconds
protected RuntimeProperty<java.lang.Boolean> sendFractionalSecondsForTime
protected boolean isLoadDataQuery
protected ColumnDefinition columnDefinition
public AbstractQueryBindings(int parameterCount,
Session sess)
protected abstract void initBindValues(int parameterCount)
public abstract AbstractQueryBindings<T> clone()
clone in interface QueryBindings<T extends BindValue>clone in class java.lang.Objectpublic void setColumnDefinition(ColumnDefinition colDef)
setColumnDefinition in interface QueryBindings<T extends BindValue>public boolean isLoadDataQuery()
isLoadDataQuery in interface QueryBindings<T extends BindValue>public void setLoadDataQuery(boolean isLoadDataQuery)
setLoadDataQuery in interface QueryBindings<T extends BindValue>public T[] getBindValues()
getBindValues in interface QueryBindings<T extends BindValue>public void setBindValues(T[] bindValues)
setBindValues in interface QueryBindings<T extends BindValue>public boolean clearBindValues()
clearBindValues in interface QueryBindings<T extends BindValue>public abstract void checkParameterSet(int columnIndex)
checkParameterSet in interface QueryBindings<T extends BindValue>public void checkAllParametersSet()
checkAllParametersSet in interface QueryBindings<T extends BindValue>public int getNumberOfExecutions()
getNumberOfExecutions in interface QueryBindings<T extends BindValue>public void setNumberOfExecutions(int numberOfExecutions)
setNumberOfExecutions in interface QueryBindings<T extends BindValue>public final void setValue(int paramIndex,
byte[] val,
MysqlType type)
setValue in interface QueryBindings<T extends BindValue>public final void setOrigValue(int paramIndex,
byte[] val)
public byte[] getOrigBytes(int parameterIndex)
getOrigBytes in interface QueryBindings<T extends BindValue>public final void setValue(int paramIndex,
java.lang.String val,
MysqlType type)
setValue in interface QueryBindings<T extends BindValue>public final void hexEscapeBlock(byte[] buf,
NativePacketPayload packet,
int size)
buf - source bytespacket - write to this packetsize - number of bytes to readpublic void setTimestamp(int parameterIndex,
java.sql.Timestamp x,
MysqlType targetMysqlType)
setTimestamp in interface QueryBindings<T extends BindValue>public void setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal,
MysqlType targetMysqlType)
setTimestamp in interface QueryBindings<T extends BindValue>public void setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar targetCalendar,
int fractionalLength,
MysqlType targetMysqlType)
setTimestamp in interface QueryBindings<T extends BindValue>public void setObject(int parameterIndex,
java.lang.Object parameterObj)
setObject in interface QueryBindings<T extends BindValue>public void setObject(int parameterIndex,
java.lang.Object parameterObj,
MysqlType targetMysqlType)
setObject in interface QueryBindings<T extends BindValue>public void setObject(int parameterIndex,
java.lang.Object parameterObj,
MysqlType targetMysqlType,
int scaleOrLength)
The given Java object will be converted to the targetMysqlType before being sent to the database.
setObject in interface QueryBindings<T extends BindValue>parameterIndex - the first parameter is 1...parameterObj - the object containing the input parameter valuetargetMysqlType - The MysqlType to be send to the databasescaleOrLength - For Types.DECIMAL or Types.NUMERIC types
this is the number of digits after the decimal. For all other
types this value will be ignored.protected final void setSerializableObject(int parameterIndex,
java.lang.Object parameterObj)
parameterIndex - parameter indexparameterObj - valuepublic boolean isNull(int parameterIndex)
isNull in interface QueryBindings<T extends BindValue>public byte[] getBytesRepresentation(int parameterIndex)
getBytesRepresentation in interface QueryBindings<T extends BindValue>