public class AsyncSession
extends java.lang.Object
AsyncOperation
and return
immediately (fine to call on the UI/main thread). The queue will be processed in a (single) background thread. The
processing order is the call order of the operations. It's possible to start multiple AsyncSessions that will
execute
concurrently.Constructor and Description |
---|
AsyncSession(AbstractDaoSession daoSession) |
Modifier and Type | Method and Description |
---|---|
AsyncOperation |
callInTx(java.util.concurrent.Callable<?> callable)
Asynchronous version of
AbstractDaoSession.callInTx(Callable) . |
AsyncOperation |
callInTx(java.util.concurrent.Callable<?> callable,
int flags)
Asynchronous version of
AbstractDaoSession.callInTx(Callable) . |
AsyncOperation |
count(java.lang.Class<?> entityClass)
Asynchronous version of
AbstractDao.count() . |
AsyncOperation |
count(java.lang.Class<?> entityClass,
int flags)
Asynchronous version of
AbstractDao.count() . |
AsyncOperation |
delete(java.lang.Object entity)
Asynchronous version of
AbstractDao.delete(Object) . |
AsyncOperation |
delete(java.lang.Object entity,
int flags)
Asynchronous version of
AbstractDao.delete(Object) . |
<E> AsyncOperation |
deleteAll(java.lang.Class<E> entityClass)
Asynchronous version of
AbstractDao.deleteAll() . |
<E> AsyncOperation |
deleteAll(java.lang.Class<E> entityClass,
int flags)
Asynchronous version of
AbstractDao.deleteAll() . |
AsyncOperation |
deleteByKey(java.lang.Object key)
Asynchronous version of
AbstractDao.deleteByKey(Object) . |
AsyncOperation |
deleteByKey(java.lang.Object key,
int flags)
Asynchronous version of
AbstractDao.deleteByKey(Object) . |
<E> AsyncOperation |
deleteInTx(java.lang.Class<E> entityClass,
E... entities)
Asynchronous version of
AbstractDao.deleteInTx(Object...) . |
<E> AsyncOperation |
deleteInTx(java.lang.Class<E> entityClass,
int flags,
E... entities)
Asynchronous version of
AbstractDao.deleteInTx(Object...) . |
<E> AsyncOperation |
deleteInTx(java.lang.Class<E> entityClass,
java.lang.Iterable<E> entities)
Asynchronous version of
AbstractDao.deleteInTx(Iterable) . |
<E> AsyncOperation |
deleteInTx(java.lang.Class<E> entityClass,
java.lang.Iterable<E> entities,
int flags)
Asynchronous version of
AbstractDao.deleteInTx(Iterable) . |
AsyncOperationListener |
getListener() |
AsyncOperationListener |
getListenerMainThread() |
int |
getMaxOperationCountToMerge() |
int |
getSessionFlags()
AsyncOperation flags set for all operations (will be ORed with call flags). |
int |
getWaitForMergeMillis() |
AsyncOperation |
insert(java.lang.Object entity)
Asynchronous version of
AbstractDao.insert(Object) . |
AsyncOperation |
insert(java.lang.Object entity,
int flags)
Asynchronous version of
AbstractDao.insert(Object) . |
<E> AsyncOperation |
insertInTx(java.lang.Class<E> entityClass,
E... entities)
Asynchronous version of
AbstractDao.insertInTx(Object...) . |
<E> AsyncOperation |
insertInTx(java.lang.Class<E> entityClass,
int flags,
E... entities)
Asynchronous version of
AbstractDao.insertInTx(Object...) . |
<E> AsyncOperation |
insertInTx(java.lang.Class<E> entityClass,
java.lang.Iterable<E> entities)
Asynchronous version of
AbstractDao.insertInTx(Iterable) . |
<E> AsyncOperation |
insertInTx(java.lang.Class<E> entityClass,
java.lang.Iterable<E> entities,
int flags)
Asynchronous version of
AbstractDao.insertInTx(Iterable) . |
AsyncOperation |
insertOrReplace(java.lang.Object entity)
Asynchronous version of
AbstractDao.insertOrReplace(Object) . |
AsyncOperation |
insertOrReplace(java.lang.Object entity,
int flags)
Asynchronous version of
AbstractDao.insertOrReplace(Object) . |
<E> AsyncOperation |
insertOrReplaceInTx(java.lang.Class<E> entityClass,
E... entities)
Asynchronous version of
AbstractDao.insertOrReplaceInTx(Object...) . |
<E> AsyncOperation |
insertOrReplaceInTx(java.lang.Class<E> entityClass,
int flags,
E... entities)
Asynchronous version of
AbstractDao.insertOrReplaceInTx(Object...) . |
<E> AsyncOperation |
insertOrReplaceInTx(java.lang.Class<E> entityClass,
java.lang.Iterable<E> entities)
Asynchronous version of
AbstractDao.insertOrReplaceInTx(Iterable) . |
<E> AsyncOperation |
insertOrReplaceInTx(java.lang.Class<E> entityClass,
java.lang.Iterable<E> entities,
int flags)
Asynchronous version of
AbstractDao.insertOrReplaceInTx(Iterable) . |
boolean |
isCompleted() |
AsyncOperation |
load(java.lang.Class<?> entityClass,
java.lang.Object key)
Asynchronous version of
AbstractDao.load(Object) . |
AsyncOperation |
load(java.lang.Class<?> entityClass,
java.lang.Object key,
int flags)
Asynchronous version of
AbstractDao.load(Object) . |
AsyncOperation |
loadAll(java.lang.Class<?> entityClass)
Asynchronous version of
AbstractDao.loadAll() . |
AsyncOperation |
loadAll(java.lang.Class<?> entityClass,
int flags)
Asynchronous version of
AbstractDao.loadAll() . |
AsyncOperation |
queryList(Query<?> query)
Asynchronous version of
Query.list() . |
AsyncOperation |
queryList(Query<?> query,
int flags)
Asynchronous version of
Query.list() . |
AsyncOperation |
queryUnique(Query<?> query)
Asynchronous version of
Query.unique() . |
AsyncOperation |
queryUnique(Query<?> query,
int flags)
Asynchronous version of
Query.unique() . |
AsyncOperation |
refresh(java.lang.Object entity)
Asynchronous version of
AbstractDao.refresh(Object) . |
AsyncOperation |
refresh(java.lang.Object entity,
int flags)
Asynchronous version of
AbstractDao.refresh(Object) . |
AsyncOperation |
runInTx(java.lang.Runnable runnable)
Asynchronous version of
AbstractDaoSession.runInTx(Runnable) . |
AsyncOperation |
runInTx(java.lang.Runnable runnable,
int flags)
Asynchronous version of
AbstractDaoSession.runInTx(Runnable) . |
void |
setListener(AsyncOperationListener listener) |
void |
setListenerMainThread(AsyncOperationListener listenerMainThread) |
void |
setMaxOperationCountToMerge(int maxOperationCountToMerge) |
void |
setSessionFlags(int sessionFlags)
AsyncOperation flags set for all operations (will be ORed with call flags). |
void |
setWaitForMergeMillis(int waitForMergeMillis) |
AsyncOperation |
update(java.lang.Object entity)
Asynchronous version of
AbstractDao.update(Object) . |
AsyncOperation |
update(java.lang.Object entity,
int flags)
Asynchronous version of
AbstractDao.update(Object) . |
<E> AsyncOperation |
updateInTx(java.lang.Class<E> entityClass,
E... entities)
Asynchronous version of
AbstractDao.updateInTx(Object...) . |
<E> AsyncOperation |
updateInTx(java.lang.Class<E> entityClass,
int flags,
E... entities)
Asynchronous version of
AbstractDao.updateInTx(Object...) . |
<E> AsyncOperation |
updateInTx(java.lang.Class<E> entityClass,
java.lang.Iterable<E> entities)
Asynchronous version of
AbstractDao.updateInTx(Iterable) . |
<E> AsyncOperation |
updateInTx(java.lang.Class<E> entityClass,
java.lang.Iterable<E> entities,
int flags)
Asynchronous version of
AbstractDao.updateInTx(Iterable) . |
void |
waitForCompletion()
Waits until all enqueued operations are complete.
|
boolean |
waitForCompletion(int maxMillis)
Waits until all enqueued operations are complete, but at most the given amount of milliseconds.
|
public AsyncSession(AbstractDaoSession daoSession)
public int getMaxOperationCountToMerge()
public void setMaxOperationCountToMerge(int maxOperationCountToMerge)
public int getWaitForMergeMillis()
public void setWaitForMergeMillis(int waitForMergeMillis)
public AsyncOperationListener getListener()
public void setListener(AsyncOperationListener listener)
public AsyncOperationListener getListenerMainThread()
public void setListenerMainThread(AsyncOperationListener listenerMainThread)
public boolean isCompleted()
public void waitForCompletion()
InterruptedException
will be rethrown as a DaoException
.public boolean waitForCompletion(int maxMillis)
InterruptedException
will be rethrown as a DaoException
.public AsyncOperation insert(java.lang.Object entity)
AbstractDao.insert(Object)
.public AsyncOperation insert(java.lang.Object entity, int flags)
AbstractDao.insert(Object)
.public <E> AsyncOperation insertInTx(java.lang.Class<E> entityClass, E... entities)
AbstractDao.insertInTx(Object...)
.public <E> AsyncOperation insertInTx(java.lang.Class<E> entityClass, int flags, E... entities)
AbstractDao.insertInTx(Object...)
.public <E> AsyncOperation insertInTx(java.lang.Class<E> entityClass, java.lang.Iterable<E> entities)
AbstractDao.insertInTx(Iterable)
.public <E> AsyncOperation insertInTx(java.lang.Class<E> entityClass, java.lang.Iterable<E> entities, int flags)
AbstractDao.insertInTx(Iterable)
.public AsyncOperation insertOrReplace(java.lang.Object entity)
AbstractDao.insertOrReplace(Object)
.public AsyncOperation insertOrReplace(java.lang.Object entity, int flags)
AbstractDao.insertOrReplace(Object)
.public <E> AsyncOperation insertOrReplaceInTx(java.lang.Class<E> entityClass, E... entities)
AbstractDao.insertOrReplaceInTx(Object...)
.public <E> AsyncOperation insertOrReplaceInTx(java.lang.Class<E> entityClass, int flags, E... entities)
AbstractDao.insertOrReplaceInTx(Object...)
.public <E> AsyncOperation insertOrReplaceInTx(java.lang.Class<E> entityClass, java.lang.Iterable<E> entities)
AbstractDao.insertOrReplaceInTx(Iterable)
.public <E> AsyncOperation insertOrReplaceInTx(java.lang.Class<E> entityClass, java.lang.Iterable<E> entities, int flags)
AbstractDao.insertOrReplaceInTx(Iterable)
.public AsyncOperation update(java.lang.Object entity)
AbstractDao.update(Object)
.public AsyncOperation update(java.lang.Object entity, int flags)
AbstractDao.update(Object)
.public <E> AsyncOperation updateInTx(java.lang.Class<E> entityClass, E... entities)
AbstractDao.updateInTx(Object...)
.public <E> AsyncOperation updateInTx(java.lang.Class<E> entityClass, int flags, E... entities)
AbstractDao.updateInTx(Object...)
.public <E> AsyncOperation updateInTx(java.lang.Class<E> entityClass, java.lang.Iterable<E> entities)
AbstractDao.updateInTx(Iterable)
.public <E> AsyncOperation updateInTx(java.lang.Class<E> entityClass, java.lang.Iterable<E> entities, int flags)
AbstractDao.updateInTx(Iterable)
.public AsyncOperation delete(java.lang.Object entity)
AbstractDao.delete(Object)
.public AsyncOperation delete(java.lang.Object entity, int flags)
AbstractDao.delete(Object)
.public AsyncOperation deleteByKey(java.lang.Object key)
AbstractDao.deleteByKey(Object)
.public AsyncOperation deleteByKey(java.lang.Object key, int flags)
AbstractDao.deleteByKey(Object)
.public <E> AsyncOperation deleteInTx(java.lang.Class<E> entityClass, E... entities)
AbstractDao.deleteInTx(Object...)
.public <E> AsyncOperation deleteInTx(java.lang.Class<E> entityClass, int flags, E... entities)
AbstractDao.deleteInTx(Object...)
.public <E> AsyncOperation deleteInTx(java.lang.Class<E> entityClass, java.lang.Iterable<E> entities)
AbstractDao.deleteInTx(Iterable)
.public <E> AsyncOperation deleteInTx(java.lang.Class<E> entityClass, java.lang.Iterable<E> entities, int flags)
AbstractDao.deleteInTx(Iterable)
.public <E> AsyncOperation deleteAll(java.lang.Class<E> entityClass)
AbstractDao.deleteAll()
.public <E> AsyncOperation deleteAll(java.lang.Class<E> entityClass, int flags)
AbstractDao.deleteAll()
.public AsyncOperation runInTx(java.lang.Runnable runnable)
AbstractDaoSession.runInTx(Runnable)
.public AsyncOperation runInTx(java.lang.Runnable runnable, int flags)
AbstractDaoSession.runInTx(Runnable)
.public AsyncOperation callInTx(java.util.concurrent.Callable<?> callable)
AbstractDaoSession.callInTx(Callable)
.public AsyncOperation callInTx(java.util.concurrent.Callable<?> callable, int flags)
AbstractDaoSession.callInTx(Callable)
.public AsyncOperation queryList(Query<?> query)
Query.list()
.public AsyncOperation queryList(Query<?> query, int flags)
Query.list()
.public AsyncOperation queryUnique(Query<?> query)
Query.unique()
.public AsyncOperation queryUnique(Query<?> query, int flags)
Query.unique()
.public AsyncOperation load(java.lang.Class<?> entityClass, java.lang.Object key)
AbstractDao.load(Object)
.public AsyncOperation load(java.lang.Class<?> entityClass, java.lang.Object key, int flags)
AbstractDao.load(Object)
.public AsyncOperation loadAll(java.lang.Class<?> entityClass)
AbstractDao.loadAll()
.public AsyncOperation loadAll(java.lang.Class<?> entityClass, int flags)
AbstractDao.loadAll()
.public AsyncOperation count(java.lang.Class<?> entityClass)
AbstractDao.count()
.public AsyncOperation count(java.lang.Class<?> entityClass, int flags)
AbstractDao.count()
.public AsyncOperation refresh(java.lang.Object entity)
AbstractDao.refresh(Object)
.public AsyncOperation refresh(java.lang.Object entity, int flags)
AbstractDao.refresh(Object)
.public int getSessionFlags()
AsyncOperation
flags set for all operations (will be ORed with call flags).public void setSessionFlags(int sessionFlags)
AsyncOperation
flags set for all operations (will be ORed with call flags).Available under the Apache License, Version 2.0 - Copyright © 2011-2015 greenrobot.de. All Rights Reserved.