| 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() |
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(org.jboss.aerogear.android.core.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(org.jboss.aerogear.android.core.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(Collection<T> items)
Saves the given objects in the underlying 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 Collection<T> readAll() throws StoreNotOpenException
readAll in interface Store<T>StoreNotOpenException - Will occur if this method is called before opening the databasepublic T read(Serializable id) throws StoreNotOpenException
read in interface Store<T>id - id from the desired objectStoreNotOpenException - Will occur if this method is called before opening the databasepublic List<T> readWithFilter(org.jboss.aerogear.android.core.ReadFilter filter) throws StoreNotOpenException
readWithFilter in interface Store<T>filter - a filter to use to fetch an objectStoreNotOpenException - Will occur if this method is called before opening the databasepublic void save(T item) throws StoreNotOpenException
save in interface Store<T>item - Object to saveStoreNotOpenException - Will occur if this method is called before opening the databasepublic void save(Collection<T> items) throws StoreNotOpenException
save in interface Store<T>items - List of objects to saveStoreNotOpenException - Will occur if this method is called before opening the databasepublic void reset()
throws StoreNotOpenException
reset in interface Store<T>StoreNotOpenException - Will occur if this method is called before opening the databasepublic boolean isEmpty()
throws StoreNotOpenException
isEmpty in interface Store<T>StoreNotOpenException - Will occur if this method is called before opening the databasepublic void remove(Serializable id) throws StoreNotOpenException
remove in interface Store<T>id - Id of item to remoteStoreNotOpenException - Will occur if this method is called before opening the databasepublic 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 © 2015 JBoss by Red Hat. All rights reserved.