| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.greenrobot.dao.AbstractDao
T - Entity typeK - Primary key (PK) type; use Void if entity does not have exactly one PKpublic abstract class AbstractDao
Base class for all DAOs: Implements entity operations like insert, load, delete, and query.
| Constructor Summary | |
|---|---|
| AbstractDao(DaoConfig config) | |
| AbstractDao(DaoConfig config, AbstractDaoSession daoSession) | |
| Method Summary | |
|---|---|
|  long | count() | 
|  void | delete(T entity)Deletes the given entity from the database. | 
|  void | deleteAll() | 
|  void | deleteByKey(K key)Deletes an entity with the given PK from the database. | 
|  boolean | detach(T entity)Detaches an entity from the identity scope (session). | 
|  java.lang.String[] | getAllColumns() | 
|  java.lang.String[] | getNonPkColumns() | 
|  java.lang.String[] | getPkColumns() | 
|  Property | getPkProperty() | 
|  Property[] | getProperties() | 
|  AbstractDaoSession | getSession() | 
|  java.lang.String | getTablename() | 
|  long | insert(T entity)Insert an entity into the table associated with a concrete DAO. | 
|  void | insertInTx(java.lang.Iterable<T> entities)Inserts the given entities in the database using a transaction. | 
|  void | insertInTx(java.lang.Iterable<T> entities, boolean setPrimaryKey)Inserts the given entities in the database using a transaction. | 
|  void | insertInTx(T... entities)Inserts the given entities in the database using a transaction. | 
|  long | insertOrReplace(T entity)Insert an entity into the table associated with a concrete DAO. | 
|  void | insertWithoutSettingPk(T entity)Insert an entity into the table associated with a concrete DAO. | 
|  T | load(K key)Loads and entity for the given PK. | 
|  java.util.List<T> | loadAll()Loads all available entities from the database. | 
|  T | loadByRowId(long rowId) | 
|  java.util.List<T> | query(java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String groupBy, java.lang.String having, java.lang.String orderby)Performs a standard Android-style query for entities. | 
|  QueryBuilder<T> | queryBuilder() | 
|  java.util.List<T> | queryRaw(java.lang.String where, java.lang.String... selectionArg)A raw-style query where you can pass any WHERE clause and arguments. | 
|  void | refresh(T entity)Resets all locally changed properties of the entity by reloading the values from the database. | 
|  void | update(T entity) | 
|  void | updateInTx(java.lang.Iterable<T> entities)Inserts the given entities in the database using a transaction. | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public AbstractDao(DaoConfig config)
public AbstractDao(DaoConfig config,
                   AbstractDaoSession daoSession)
  | Method Detail | 
|---|
public AbstractDaoSession getSession()
public java.lang.String getTablename()
public Property[] getProperties()
public Property getPkProperty()
public java.lang.String[] getAllColumns()
public java.lang.String[] getPkColumns()
public java.lang.String[] getNonPkColumns()
public T load(K key)
key - a PK value or nullpublic T loadByRowId(long rowId)
public java.util.List<T> loadAll()
public boolean detach(T entity)
public void insertInTx(java.lang.Iterable<T> entities)
entities - The entities to insert.public void insertInTx(T... entities)
entities - The entities to insert.
public void insertInTx(java.lang.Iterable<T> entities,
                       boolean setPrimaryKey)
  entities - The entities to insert.setPrimaryKey - if true, the PKs of the given will be set after the insert; pass false to improve performance.public long insert(T entity)
public void insertWithoutSettingPk(T entity)
public long insertOrReplace(T entity)
public java.util.List<T> queryRaw(java.lang.String where,
                                  java.lang.String... selectionArg)
  
public java.util.List<T> query(java.lang.String selection,
                               java.lang.String[] selectionArgs,
                               java.lang.String groupBy,
                               java.lang.String having,
                               java.lang.String orderby)
  public void deleteAll()
public void delete(T entity)
public void deleteByKey(K key)
public void refresh(T entity)
public void update(T entity)
public QueryBuilder<T> queryBuilder()
public void updateInTx(java.lang.Iterable<T> entities)
entities - The entities to insert.setPrimaryKey - if true, the PKs of the given will be set after the insert; pass false to improve performance.public long count()
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||