public interface CRUD
| Modifier and Type | Method and Description |
|---|---|
void |
cancelNotification()
Removes notifications broadcasted by this plug-in.
|
boolean |
deleteRow(java.lang.String table,
java.lang.String whereClause,
java.lang.String[] whereArgs)
Method for deleting rows in the database.
|
void |
fireNotification(java.lang.String title,
java.lang.String text)
Sends a notification to be broadcasted by the host.
|
boolean |
initialise() |
void |
insert(java.lang.String table,
android.content.ContentValues values)
Method for inserting a row into the database.
|
com.kasapakis.adam.plugin_model_library_core.database.CustomCursor |
query(java.lang.String pluginName,
int dbVersion,
java.lang.String tableName,
java.lang.String[] columns,
java.lang.String selection,
java.lang.String[] selectionArgs,
java.lang.String groupBy,
java.lang.String having,
java.lang.String orderBy) |
boolean |
replace(java.lang.String table,
java.lang.String nullColumnHack,
android.content.ContentValues initialValues)
Method for replacing a row in the database.
|
void insert(java.lang.String table,
android.content.ContentValues values)
throws com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException,
com.kasapakis.adam.plugin_model_library_core.exceptions.NotInitialisedException
table - String: the table to insert the row intovalues - ContentValues: this map contains the initial column values for the row.
The keys should be the column names and the values the column values.com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException - thrown if the plug-in is not activated in host application.com.kasapakis.adam.plugin_model_library_core.exceptions.NotInitialisedException - thrown if the plug-in is not initialised.boolean initialise()
com.kasapakis.adam.plugin_model_library_core.database.CustomCursor query(java.lang.String pluginName,
int dbVersion,
java.lang.String tableName,
java.lang.String[] columns,
java.lang.String selection,
java.lang.String[] selectionArgs,
java.lang.String groupBy,
java.lang.String having,
java.lang.String orderBy)
throws com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException,
com.kasapakis.adam.plugin_model_library_core.exceptions.NotInitialisedException
pluginName - String: name of the plugin that created the table.
This is necessary to check if the table exists.
If reading from your own tables set to NULL.dbVersion - int: version of the database Schema that defines the table.tableName - String: The table name 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.selection - String[]: 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 table.selectionArgs - String[]: You may include ?s in selection, which will be replaced by the
value from selectionArgs, in order that they appear in the selection.
The values will be bound as Strings.groupBy - String: 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 - String: A filter declare which row groups to include in the cursor,
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 - String: 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.com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException - thrown if the plug-in is not activated in host applicationcom.kasapakis.adam.plugin_model_library_core.exceptions.NotInitialisedException - thrown if the plug-in that create the tables that are queried
is not initialised in host application.boolean deleteRow(java.lang.String table,
java.lang.String whereClause,
java.lang.String[] whereArgs)
throws com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException,
com.kasapakis.adam.plugin_model_library_core.exceptions.NotInitialisedException
table - String: the table to delete from.whereClause - String: the optional WHERE clause to apply when deleting.
Passing null will delete all rows.whereArgs - String: You may include ?s in the where clause, which will be replaced
by the values from whereArgs. The values will be bound as Strings.com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException - thrown if the plug-in is not activated in host application.com.kasapakis.adam.plugin_model_library_core.exceptions.NotInitialisedException - thrown if the plug-in is not initialised.boolean replace(java.lang.String table,
java.lang.String nullColumnHack,
android.content.ContentValues initialValues)
throws com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException,
com.kasapakis.adam.plugin_model_library_core.exceptions.NotInitialisedException
table - String: the table in which to replace the rownullColumnHack - String: optional; may be null. SQL doesn't allow inserting a
completely empty row without naming at least one column name.
If your provided initialValues is empty, no column names are known and
an empty row can't be inserted. If not set to null, the nullColumnHack
parameter provides the name of nullable column name to explicitly
insert a NULL into in the case where your initialValues is empty.initialValues - ContentValues: this map contains the initial column values for the row.
The keys should be the column names and the values the column values.com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException - thrown if the plug-in is not activated in host application.com.kasapakis.adam.plugin_model_library_core.exceptions.NotInitialisedException - thrown if the plug-in is not initialised.void fireNotification(java.lang.String title,
java.lang.String text)
throws com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException
title - String: title of the notificationtext - String: message of the notificationcom.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException - thrown if the plug-in is not activated in host applicationvoid cancelNotification()
throws com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException
com.kasapakis.adam.plugin_model_library_core.exceptions.NotActivatedException - thrown if the plug-in is not activated in host application¬