com.j256.ormlite.stmt.mapped
Class MappedPreparedStmt<T,ID>
java.lang.Object
com.j256.ormlite.stmt.mapped.BaseMappedStatement<T,ID>
com.j256.ormlite.stmt.mapped.BaseMappedQuery<T,ID>
com.j256.ormlite.stmt.mapped.MappedPreparedStmt<T,ID>
- All Implemented Interfaces:
- GenericRowMapper<T>, PreparedDelete<T>, PreparedQuery<T>, PreparedStmt<T>, PreparedUpdate<T>
public class MappedPreparedStmt<T,ID>
- extends BaseMappedQuery<T,ID>
- implements PreparedQuery<T>, PreparedDelete<T>, PreparedUpdate<T>
Mapped statement used by the StatementBuilder.prepareStatement(Long)
method.
- Author:
- graywatson
MappedPreparedStmt
public MappedPreparedStmt(TableInfo<T,ID> tableInfo,
String statement,
FieldType[] argFieldTypes,
FieldType[] resultFieldTypes,
ArgumentHolder[] argHolders,
Long limit,
StatementBuilder.StatementType type)
compile
public CompiledStatement compile(DatabaseConnection databaseConnection,
StatementBuilder.StatementType type)
throws SQLException
- Description copied from interface:
PreparedStmt
- Create and return the associated compiled statement.
- Specified by:
compile
in interface PreparedStmt<T>
- Throws:
SQLException
compile
public CompiledStatement compile(DatabaseConnection databaseConnection,
StatementBuilder.StatementType type,
int resultFlags)
throws SQLException
- Description copied from interface:
PreparedStmt
- Like compile(DatabaseConnection, StatementType) but allows to specify the result flags.
- Specified by:
compile
in interface PreparedStmt<T>
resultFlags
- Set to -1 for default.
- Throws:
SQLException
getStatement
public String getStatement()
- Description copied from interface:
PreparedStmt
- Return the associated SQL statement string for logging purposes.
- Specified by:
getStatement
in interface PreparedStmt<T>
getType
public StatementBuilder.StatementType getType()
- Description copied from interface:
PreparedStmt
- Return the type of the statement for internal consistency checking.
- Specified by:
getType
in interface PreparedStmt<T>
setArgumentHolderValue
public void setArgumentHolderValue(int index,
Object value)
throws SQLException
- Description copied from interface:
PreparedStmt
- If any argument holder's have been set in this prepared statement then this is a convenience method to be able to
set them.
NOTE 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.
- Specified by:
setArgumentHolderValue
in interface PreparedStmt<T>
- Parameters:
index
- The index of the holder you are going to set, 0 based. See NOTE above.value
- Object to set in the argument holder.
- Throws:
SQLException
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.