public abstract class DatabaseSupportBase extends Object implements DatabaseSupport, ConnectionSourceFactory
DatabaseSupport.ConnectionType| Modifier and Type | Field and Description |
|---|---|
static String |
DATABASE_INFO_NAME
Table to hold database version
|
| Modifier and Type | Method and Description |
|---|---|
static String |
buildQueryString(String tables,
String[] columns,
String where,
String groupBy,
String having,
String orderBy,
String limit)
Build an SQL query string from the given clauses.
|
void |
close()
Perform any clean up required on database shutdown
|
com.j256.ormlite.support.ConnectionSource |
getConnectionSource(String databaseName,
Properties properties)
Returns ConnectionSource object
|
com.j256.ormlite.db.DatabaseType |
getDatabaseType()
Returns database type
|
List<OpenHelperCallbacks> |
getOpenHelperCallbacksList() |
List<Object> |
getResultList(com.j256.ormlite.support.ConnectionSource connectionSource,
QueryInfo queryInfo,
int startPosition,
int maxResults)
Returns list result of native query in Android SQLite API format
|
Object |
getSingleResult(com.j256.ormlite.support.ConnectionSource connectionSource,
QueryInfo queryInfo)
Returns single result of native query in Android SQLite API format
|
int |
getVersion(com.j256.ormlite.support.ConnectionSource connectionSource)
Gets the database version.
|
void |
initialize()
Perform any inititialization required prior to creating first database connection
|
void |
registerOpenHelperCallbacks(OpenHelperCallbacks openHelperCallbacks) |
void |
setVersion(int version,
com.j256.ormlite.support.ConnectionSource connectionSource)
Sets the database version.
|
public static final String DATABASE_INFO_NAME
public void initialize()
initialize in interface DatabaseSupportpublic com.j256.ormlite.support.ConnectionSource getConnectionSource(String databaseName, Properties properties)
getConnectionSource in interface ConnectionSourceFactorydatabaseName - properties - Properties defined in persistence.xmlpublic void close()
close in interface DatabaseSupportpublic com.j256.ormlite.db.DatabaseType getDatabaseType()
getDatabaseType in interface DatabaseSupportpublic void registerOpenHelperCallbacks(OpenHelperCallbacks openHelperCallbacks)
registerOpenHelperCallbacks in interface DatabaseSupportpublic List<OpenHelperCallbacks> getOpenHelperCallbacksList()
getOpenHelperCallbacksList in interface DatabaseSupportpublic int getVersion(com.j256.ormlite.support.ConnectionSource connectionSource)
getVersion in interface DatabaseSupportconnectionSource - Open ConnectionSource object of database.public void setVersion(int version,
com.j256.ormlite.support.ConnectionSource connectionSource)
setVersion in interface DatabaseSupportconnectionSource - Open ConnectionSource object of database. Can be null for Android SQLite.version - the new database versionpublic List<Object> getResultList(com.j256.ormlite.support.ConnectionSource connectionSource, QueryInfo queryInfo, int startPosition, int maxResults)
getResultList in interface DatabaseSupportconnectionSource - Open ConnectionSource objectqueryInfo - QueryInfostartPosition - intmaxResults - intpublic Object getSingleResult(com.j256.ormlite.support.ConnectionSource connectionSource, QueryInfo queryInfo)
getSingleResult in interface DatabaseSupportconnectionSource - Open ConnectionSource objectqueryInfo - QueryInfopublic static String buildQueryString(String tables, String[] columns, String where, String groupBy, String having, String orderBy, String limit)
tables - The table names to compile the query against.columns - A list of which columns to return. Passing null will
return all columns, which is discouraged to prevent reading
data from storage that isn't going to be used.where - A filter declaring which rows to return, formatted as an SQL
WHERE clause (excluding the WHERE itself). Passing null will
return all rows for the given URL.groupBy - A filter declaring how to group rows, formatted as an SQL
GROUP BY clause (excluding the GROUP BY itself). Passing null
will cause the rows to not be grouped.having - A filter declare which row groups to include in the results,
if row grouping is being used, formatted as an SQL HAVING
clause (excluding the HAVING itself). Passing null will cause
all row groups to be included, and is required when row
grouping is not being used.orderBy - How to order the rows, formatted as an SQL ORDER BY clause
(excluding the ORDER BY itself). Passing null will use the
default sort order, which may be unordered.limit - Limits the number of rows returned by the query,
formatted as LIMIT clause. Passing null denotes no LIMIT clause.This documentation is licensed by Andrew Bowley under the GPLv3 License.