public class DatabaseController
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
DatabaseController() |
| Modifier and Type | Method and Description |
|---|---|
InsertQuery |
createInsertQuery(Model model) |
java.lang.String |
getClause(Clause[] clause)
Build the conditional clause
|
java.lang.String[] |
getClauseArgs(Clause[] clause)
Build the clause arguments
|
android.content.ContentValues |
getContentValuesFromModel(Model model)
Populate a ContentValues collection based on the field values stored in baseModel
|
java.lang.String |
getLimit(Limit limit)
Build the limit keyword part of the SQL statement
|
java.lang.String |
getOrderBy(OrderBy orderBy)
Build the order by keyword part of the SQL statement
|
java.lang.String[] |
getSQLColumnNamesFromModel(java.lang.Class<?> classDef)
Retrieve the column names for the provided BaseModel
|
static java.lang.String |
getSQLDataTypeFromClassRef(java.lang.Class<?> classDef)
Determine the data type of the provided class reference and return
the associated SQL data type
|
java.lang.String |
getTableName(java.lang.Class<?> classDef)
The table name is determined by the model class name
|
java.lang.String |
getTableName(Model model)
The table name is determined by the model class name
|
<T> T[] |
retrieveSQLSelectResults(java.lang.Class<?> classDef,
android.database.Cursor cursor)
A generic method that takes any class interface that extends BaseModel, it takes the provided
cursor and populates a new instance of the provided BaseModel interface with the results.
|
public java.lang.String getTableName(java.lang.Class<?> classDef)
classDef - public java.lang.String getTableName(Model model)
model - public java.lang.String getClause(Clause[] clause)
clause - public java.lang.String[] getClauseArgs(Clause[] clause)
clause - public java.lang.String getOrderBy(OrderBy orderBy)
orderBy - public java.lang.String getLimit(Limit limit)
limit - public InsertQuery createInsertQuery(Model model)
public java.lang.String[] getSQLColumnNamesFromModel(java.lang.Class<?> classDef)
classDef - The classDef of the model to retrieve the column name forpublic android.content.ContentValues getContentValuesFromModel(Model model)
model - The baseModel to get the ContentValues frompublic <T> T[] retrieveSQLSelectResults(java.lang.Class<?> classDef,
android.database.Cursor cursor)
classDef - The class interface to return the cursor results incursor - The provided SQLite cursor that the results should be populated frompublic static java.lang.String getSQLDataTypeFromClassRef(java.lang.Class<?> classDef)
classDef - The class reference