public class AbstractDaoSession
extends java.lang.Object
Constructor and Description |
---|
AbstractDaoSession(android.database.sqlite.SQLiteDatabase db) |
Modifier and Type | Method and Description |
---|---|
<V> V |
callInTx(java.util.concurrent.Callable<V> callable)
Calls the given Callable inside a database transaction and returns the result of the Callable.
|
<V> V |
callInTxNoException(java.util.concurrent.Callable<V> callable)
Like
callInTx(Callable) but does not require Exception handling (rethrows an Exception as a runtime
DaoException). |
<T> void |
delete(T entity)
Convenient call for
AbstractDao.delete(Object) . |
<T> void |
deleteAll(java.lang.Class<T> entityClass)
Convenient call for
AbstractDao.deleteAll() . |
java.util.Collection<AbstractDao<?,?>> |
getAllDaos()
Allows to inspect the meta model using DAOs (e.g. querying table names or properties).
|
AbstractDao<?,?> |
getDao(java.lang.Class<? extends java.lang.Object> entityClass) |
android.database.sqlite.SQLiteDatabase |
getDatabase()
Gets the SQLiteDatabase for custom database access.
|
<T> long |
insert(T entity)
Convenient call for
AbstractDao.insert(Object) . |
<T> long |
insertOrReplace(T entity)
Convenient call for
AbstractDao.insertOrReplace(Object) . |
<T,K> T |
load(java.lang.Class<T> entityClass,
K key)
Convenient call for
AbstractDao.load(Object) . |
<T,K> java.util.List<T> |
loadAll(java.lang.Class<T> entityClass)
Convenient call for
AbstractDao.loadAll() . |
<T> QueryBuilder<T> |
queryBuilder(java.lang.Class<T> entityClass)
Convenient call for
AbstractDao.queryBuilder() . |
<T,K> java.util.List<T> |
queryRaw(java.lang.Class<T> entityClass,
java.lang.String where,
java.lang.String... selectionArgs)
Convenient call for
AbstractDao.queryRaw(String, String...) . |
<T> void |
refresh(T entity)
Convenient call for
AbstractDao.refresh(Object) . |
protected <T> void |
registerDao(java.lang.Class<T> entityClass,
AbstractDao<T,?> dao) |
void |
runInTx(java.lang.Runnable runnable)
Run the given Runnable inside a database transaction.
|
AsyncSession |
startAsyncSession()
Creates a new
AsyncSession to issue asynchronous entity operations. |
<T> void |
update(T entity)
Convenient call for
AbstractDao.update(Object) . |
public AbstractDaoSession(android.database.sqlite.SQLiteDatabase db)
protected <T> void registerDao(java.lang.Class<T> entityClass, AbstractDao<T,?> dao)
public <T> long insert(T entity)
AbstractDao.insert(Object)
.public <T> long insertOrReplace(T entity)
AbstractDao.insertOrReplace(Object)
.public <T> void refresh(T entity)
AbstractDao.refresh(Object)
.public <T> void update(T entity)
AbstractDao.update(Object)
.public <T> void delete(T entity)
AbstractDao.delete(Object)
.public <T> void deleteAll(java.lang.Class<T> entityClass)
AbstractDao.deleteAll()
.public <T,K> T load(java.lang.Class<T> entityClass, K key)
AbstractDao.load(Object)
.public <T,K> java.util.List<T> loadAll(java.lang.Class<T> entityClass)
AbstractDao.loadAll()
.public <T,K> java.util.List<T> queryRaw(java.lang.Class<T> entityClass, java.lang.String where, java.lang.String... selectionArgs)
AbstractDao.queryRaw(String, String...)
.public <T> QueryBuilder<T> queryBuilder(java.lang.Class<T> entityClass)
AbstractDao.queryBuilder()
.public AbstractDao<?,?> getDao(java.lang.Class<? extends java.lang.Object> entityClass)
public void runInTx(java.lang.Runnable runnable)
public <V> V callInTx(java.util.concurrent.Callable<V> callable) throws java.lang.Exception
java.lang.Exception
public <V> V callInTxNoException(java.util.concurrent.Callable<V> callable)
callInTx(Callable)
but does not require Exception handling (rethrows an Exception as a runtime
DaoException).public android.database.sqlite.SQLiteDatabase getDatabase()
public java.util.Collection<AbstractDao<?,?>> getAllDaos()
public AsyncSession startAsyncSession()
AsyncSession
to issue asynchronous entity operations. See AsyncSession
for details.Available under the Apache License, Version 2.0 - Copyright © 2011-2015 greenrobot.de. All Rights Reserved.