|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.j256.ormlite.stmt.StatementBuilder<T,ID>
public abstract class StatementBuilder<T,ID>
Assists in building of SQL statements for a particular table in a particular database.
| Nested Class Summary | |
|---|---|
static class |
StatementBuilder.StatementType
Types of statements that we are building. |
| Field Summary | |
|---|---|
protected DatabaseType |
databaseType
|
protected Long |
limit
|
protected Long |
offset
|
protected TableInfo<T,ID> |
tableInfo
|
protected StatementBuilder.StatementType |
type
|
| Constructor Summary | |
|---|---|
StatementBuilder(DatabaseType databaseType,
TableInfo<T,ID> tableInfo,
StatementBuilder.StatementType type)
Provides statements for various SQL operations. |
|
| Method Summary | |
|---|---|
protected abstract void |
appendStatementEnd(StringBuilder sb)
Append the end of our statement string to the StringBuilder. |
protected abstract void |
appendStatementStart(StringBuilder sb,
List<ArgumentHolder> argList)
Append the start of our statement string to the StringBuilder. |
protected void |
appendStatementString(StringBuilder sb,
List<ArgumentHolder> argList)
Internal method to build a query while tracking various arguments. |
protected FieldType[] |
getResultFieldTypes()
Get the result array from our statement after the appendStatementStart(StringBuilder, List) was called. |
protected MappedPreparedStmt<T,ID> |
prepareStatement()
Prepare our statement for the subclasses. |
String |
prepareStatementString()
Build and return a string version of the query. |
void |
setWhere(Where<T,ID> where)
Set the Where object on the query. |
protected FieldType |
verifyColumnName(String columnName)
Verify the columnName is valid and return its FieldType. |
Where<T,ID> |
where()
Returns a Where object that should be used to add SQL where clauses to the statement. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final TableInfo<T,ID> tableInfo
protected final DatabaseType databaseType
protected StatementBuilder.StatementType type
protected Long limit
protected Long offset
| Constructor Detail |
|---|
public StatementBuilder(DatabaseType databaseType,
TableInfo<T,ID> tableInfo,
StatementBuilder.StatementType type)
databaseType - Database type.tableInfo - Information about the table/class that is being handled.type - Type of statement we are building.| Method Detail |
|---|
public Where<T,ID> where()
Where object that should be used to add SQL where clauses to the statement. This will also
reset the where object so you can use the same query builder with a different where statement.
public void setWhere(Where<T,ID> where)
Where object on the query. This allows someone to use the same Where object on multiple queries.
protected MappedPreparedStmt<T,ID> prepareStatement()
throws SQLException
SQLException
public String prepareStatementString()
throws SQLException
SQLException
protected void appendStatementString(StringBuilder sb,
List<ArgumentHolder> argList)
throws SQLException
prepareStatementString() method instead.
This needs to be protected because of (WARNING: DO NOT MAKE A JAVADOC LINK) InternalQueryBuilder (WARNING: DO NOT MAKE A JAVADOC LINK).
SQLException
protected abstract void appendStatementStart(StringBuilder sb,
List<ArgumentHolder> argList)
throws SQLException
SQLExceptionprotected FieldType[] getResultFieldTypes()
appendStatementStart(StringBuilder, List) was called.
This will be null except for the QueryBuilder.
protected abstract void appendStatementEnd(StringBuilder sb)
throws SQLException
SQLExceptionprotected FieldType verifyColumnName(String columnName)
IllegalArgumentException - if the column name is not valid.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||