public class MappedPreparedStmt<T,ID> extends BaseMappedQuery<T,ID> implements PreparedQuery<T>, PreparedDelete<T>, PreparedUpdate<T>
StatementBuilder.prepareStatement(Long, boolean) method.resultsFieldTypesargFieldTypes, clazz, connectionSource, dao, idField, logger, statement, tableInfo| Constructor and Description |
|---|
MappedPreparedStmt(Dao<T,ID> dao,
TableInfo<T,ID> tableInfo,
String statement,
FieldType[] argFieldTypes,
FieldType[] resultFieldTypes,
ArgumentHolder[] argHolders,
Long limit,
StatementBuilder.StatementType type,
boolean cacheStore) |
| Modifier and Type | Method and Description |
|---|---|
CompiledStatement |
compile(DatabaseConnection databaseConnection,
StatementBuilder.StatementType type)
Create and return the associated compiled statement.
|
CompiledStatement |
compile(DatabaseConnection databaseConnection,
StatementBuilder.StatementType type,
int resultFlags)
Like compile(DatabaseConnection, StatementType) but allows to specify the result flags.
|
int |
getNumArgs()
Return the number of associated arguments with the statement.
|
String |
getStatement()
Return the associated SQL statement string for logging purposes.
|
StatementBuilder.StatementType |
getType()
Return the type of the statement for internal consistency checking.
|
void |
setArgumentHolderValue(int index,
Object value)
If any argument holder's have been set in this prepared statement then this is a convenience method to be able to
set them.
|
mapRow, setParentInformationconvertIdToFieldObject, getFieldObjects, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmapRowpublic CompiledStatement compile(DatabaseConnection databaseConnection, StatementBuilder.StatementType type) throws SQLException
PreparedStmtAutoCloseable.close() after you
are done with the statement so any database connections can be freed.compile in interface PreparedStmt<T>SQLExceptionpublic CompiledStatement compile(DatabaseConnection databaseConnection, StatementBuilder.StatementType type, int resultFlags) throws SQLException
PreparedStmtcompile in interface PreparedStmt<T>resultFlags - Set to -1 for default.SQLExceptionpublic String getStatement()
PreparedStmtgetStatement in interface PreparedStmt<T>public StatementBuilder.StatementType getType()
PreparedStmtgetType in interface PreparedStmt<T>public void setArgumentHolderValue(int index,
Object value)
throws SQLException
PreparedStmtNOTE This method is for folks who know what they are doing. Unfortunately the index of the argument holder is dependent on how the query was built which for complex queries may be difficult to determine. Also, certain field types (such as a Date) allocate an argument internally so you will need to take this into account.
setArgumentHolderValue in interface PreparedStmt<T>index - The index of the holder you are going to set, 0 based. See NOTE above.value - Object to set in the argument holder.SQLExceptionpublic int getNumArgs()
PreparedStmtgetNumArgs in interface PreparedStmt<T>This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.