| Constructor and Description |
|---|
SQLStore(Class<T> klass,
android.content.Context context) |
SQLStore(Class<T> klass,
android.content.Context context,
com.google.gson.GsonBuilder builder,
IdGenerator generator) |
SQLStore(Class<T> klass,
android.content.Context context,
com.google.gson.GsonBuilder builder,
IdGenerator generator,
String databaseName) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
StoreType |
getType()
Returns the type of the underlying 'store implementation'
|
boolean |
isEmpty()
Checks if the storage system contains no stored elements.
|
void |
onCreate(android.database.sqlite.SQLiteDatabase db) |
void |
onUpgrade(android.database.sqlite.SQLiteDatabase db,
int oldVersion,
int newVersion) |
void |
open(Callback<SQLStore<T>> onReady) |
void |
openSync() |
T |
read(Serializable id)
Reads a specific object/record from the underlying storage system.
|
Collection<T> |
readAll()
Reads all the data from the underlying storage system.
|
List<T> |
readWithFilter(ReadFilter filter)
Search for objects/records from the underlying storage system.
|
void |
remove(Serializable id)
Removes a specific object/record from the underlying storage system.
|
void |
reset()
Resets the entire storage system.
|
void |
save(T item)
Saves the given object in the underlying storage system.
|
public SQLStore(Class<T> klass, android.content.Context context, com.google.gson.GsonBuilder builder, IdGenerator generator)
public SQLStore(Class<T> klass, android.content.Context context, com.google.gson.GsonBuilder builder, IdGenerator generator, String databaseName)
public StoreType getType()
public Collection<T> readAll()
public T read(Serializable id)
public List<T> readWithFilter(ReadFilter filter)
readWithFilter in interface Store<T>filter - a filter to use to fetch an objectpublic void save(T item)
public void reset()
public boolean isEmpty()
public void remove(Serializable id)
public void onCreate(android.database.sqlite.SQLiteDatabase db)
onCreate in class android.database.sqlite.SQLiteOpenHelperpublic void onUpgrade(android.database.sqlite.SQLiteDatabase db,
int oldVersion,
int newVersion)
onUpgrade in class android.database.sqlite.SQLiteOpenHelperpublic void openSync()
public void close()
close in class android.database.sqlite.SQLiteOpenHelperCopyright © 2014 JBoss by Red Hat. All rights reserved.