public abstract class AbstractPreparedQuery<T extends QueryBindings<?>> extends AbstractQuery implements PreparedQuery<T>
Query.CancelStatus
Modifier and Type | Field and Description |
---|---|
protected RuntimeProperty<java.lang.Boolean> |
autoClosePStmtStreams |
protected int |
batchCommandIndex
Command index of currently executing batch command.
|
protected java.lang.String |
originalSql
The SQL that was passed in to 'prepare'
|
protected int |
parameterCount
The number of parameters in this PreparedStatement
|
protected ParseInfo |
parseInfo |
protected T |
queryBindings |
protected RuntimeProperty<java.lang.Boolean> |
useStreamLengthsInPrepStmts |
batchedArgs, cancelTimeoutMutex, charEncoding, clearWarningsCalled, currentDb, fetchSize, maxAllowedPacket, resultSetType, session, statementExecuting, statementId, timeoutInMillis
Constructor and Description |
---|
AbstractPreparedQuery(NativeSession sess) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asSql() |
java.lang.String |
asSql(boolean quoteStreamsAndUnknowns) |
void |
checkNullOrEmptyQuery(java.lang.String sql)
Method checkNullOrEmptyQuery.
|
void |
closeQuery() |
int |
computeBatchSize(int numBatchedArgs)
Computes the optimum number of batched parameter lists to send
without overflowing max_allowed_packet.
|
protected abstract long[] |
computeMaxParameterSetSizeAndBatchSize(int numBatchedArgs) |
<M extends Message> |
fillSendPacket()
Creates the packet that contains the query to be sent to the server.
|
<M extends Message> |
fillSendPacket(QueryBindings<?> bindings)
Creates the packet that contains the query to be sent to the server.
|
int |
getBatchCommandIndex() |
java.lang.String |
getOriginalSql() |
int |
getParameterCount() |
ParseInfo |
getParseInfo() |
T |
getQueryBindings() |
void |
setBatchCommandIndex(int batchCommandIndex) |
void |
setOriginalSql(java.lang.String originalSql) |
void |
setParameterCount(int parameterCount) |
void |
setParseInfo(ParseInfo parseInfo) |
void |
setQueryBindings(T queryBindings) |
addBatch, checkCancelTimeout, clearBatchedArgs, getBatchedArgs, getCancelTimeoutMutex, getCurrentDatabase, getExecuteTime, getId, getResultFetchSize, getResultSetFactory, getResultType, getSession, getStatementExecuting, getTimeoutInMillis, isClearWarningsCalled, resetCancelledState, setCancelStatus, setClearWarningsCalled, setCurrentDatabase, setExecuteTime, setResultFetchSize, setResultType, setTimeoutInMillis, startQueryTimer, statementBegins, stopQueryTimer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBatch, checkCancelTimeout, clearBatchedArgs, getBatchedArgs, getCancelTimeoutMutex, getCurrentDatabase, getExecuteTime, getId, getResultFetchSize, getResultSetFactory, getResultType, getSession, getStatementExecuting, getTimeoutInMillis, isClearWarningsCalled, resetCancelledState, setCancelStatus, setClearWarningsCalled, setCurrentDatabase, setExecuteTime, setResultFetchSize, setResultType, setTimeoutInMillis, startQueryTimer, statementBegins, stopQueryTimer
protected ParseInfo parseInfo
protected T extends QueryBindings<?> queryBindings
protected java.lang.String originalSql
protected int parameterCount
protected RuntimeProperty<java.lang.Boolean> autoClosePStmtStreams
protected int batchCommandIndex
protected RuntimeProperty<java.lang.Boolean> useStreamLengthsInPrepStmts
public AbstractPreparedQuery(NativeSession sess)
public void closeQuery()
closeQuery
in interface Query
closeQuery
in class AbstractQuery
public ParseInfo getParseInfo()
getParseInfo
in interface PreparedQuery<T extends QueryBindings<?>>
public void setParseInfo(ParseInfo parseInfo)
setParseInfo
in interface PreparedQuery<T extends QueryBindings<?>>
public java.lang.String getOriginalSql()
getOriginalSql
in interface PreparedQuery<T extends QueryBindings<?>>
public void setOriginalSql(java.lang.String originalSql)
setOriginalSql
in interface PreparedQuery<T extends QueryBindings<?>>
public int getParameterCount()
getParameterCount
in interface PreparedQuery<T extends QueryBindings<?>>
public void setParameterCount(int parameterCount)
setParameterCount
in interface PreparedQuery<T extends QueryBindings<?>>
public T getQueryBindings()
getQueryBindings
in interface PreparedQuery<T extends QueryBindings<?>>
public void setQueryBindings(T queryBindings)
setQueryBindings
in interface PreparedQuery<T extends QueryBindings<?>>
public int getBatchCommandIndex()
getBatchCommandIndex
in interface PreparedQuery<T extends QueryBindings<?>>
public void setBatchCommandIndex(int batchCommandIndex)
setBatchCommandIndex
in interface PreparedQuery<T extends QueryBindings<?>>
public int computeBatchSize(int numBatchedArgs)
computeBatchSize
in interface PreparedQuery<T extends QueryBindings<?>>
numBatchedArgs
- original batch sizepublic void checkNullOrEmptyQuery(java.lang.String sql)
checkNullOrEmptyQuery
in interface PreparedQuery<T extends QueryBindings<?>>
sql
- the SQL to checkWrongArgumentException
- if query is null or empty.public java.lang.String asSql()
asSql
in interface PreparedQuery<T extends QueryBindings<?>>
public java.lang.String asSql(boolean quoteStreamsAndUnknowns)
asSql
in interface PreparedQuery<T extends QueryBindings<?>>
protected abstract long[] computeMaxParameterSetSizeAndBatchSize(int numBatchedArgs)
public <M extends Message> M fillSendPacket()
fillSendPacket
in interface PreparedQuery<T extends QueryBindings<?>>
public <M extends Message> M fillSendPacket(QueryBindings<?> bindings)
fillSendPacket
in interface PreparedQuery<T extends QueryBindings<?>>
bindings
- values