public abstract class TypeDaoImpl<T,ID extends Serializable> extends DaoImpl<T,ID,Long,CursorIterable,android.content.ContentValues,Long>
| Modifier and Type | Field and Description |
|---|---|
protected android.database.sqlite.SQLiteDatabase.CursorFactory |
cursorFactory |
protected static Properties |
DATA_TYPES_DEFAULT |
protected static AbstractDatabaseHelper |
databaseHelper |
protected int |
minLogPriority |
protected static String |
OPERATION_IN |
static SimpleDateFormat |
SDF |
protected String |
TAG |
AUDIT_CURSOR_PREFIX, COLUMN_NAME_GEOBOXES_DEFAULT, mardaoParentDao, memCacheAll, memCacheEntities, persistentClass, populateTotalSize, PRINCIPAL_NAME_ANONYMOUS, RUNNABLE_VOID, simpleIdClass| Modifier | Constructor and Description |
|---|---|
protected |
TypeDaoImpl(Class<T> type,
Class<ID> idType) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendColumnDefinition(StringBuffer sql,
String columnName) |
protected void |
appendColumnDefinition(StringBuffer sql,
String columnName,
boolean isPrimaryKey) |
protected void |
appendConstraint(StringBuffer sql,
String columnName,
DaoImpl foreignDao) |
protected void |
appendConstraints(StringBuffer sql) |
protected void |
appendParentKeyColumnDefinition(StringBuffer sql) |
protected static String |
appendWhereFilters(ArrayList<String> sArgs,
Filter... filters) |
static ArrayList |
asList(Iterable itrbl) |
protected List<ID> |
convert(android.database.Cursor cursor) |
protected Long |
coreKeyToParentKey(Long core) |
protected ID |
coreKeyToSimpleKey(Long core) |
protected Long |
coreToParentKey(android.content.ContentValues core) |
protected ID |
coreToSimpleKey(android.content.ContentValues core) |
protected int |
count(Object ancestorKey,
Object simpleKey,
Filter... filters) |
protected android.content.ContentValues |
createCore(Object primaryKey) |
protected android.content.ContentValues |
createCore(Object parentKey,
ID simpleKey) |
protected Long |
createCoreKey(Object parentKey,
ID simpleKey) |
T |
createDomain(CursorIterable cursor)
Invoked by CursorIterable to map from cursor to domain object
|
Filter |
createEqualsFilter(String columnName,
Object value) |
Filter |
createGreaterThanOrEqualFilter(String columnName,
Object value) |
Filter |
createInFilter(String fieldName,
Collection param) |
protected String |
createMemCacheKey(Object parentKey,
ID simpleKey) |
protected String |
createTable() |
int |
deleteAll() |
protected int |
doDelete(Iterable<T> domains) |
protected int |
doDelete(Object parentKey,
Iterable<ID> simpleKeys) |
protected T |
doFindByPrimaryKey(Object parentKey,
ID simpleKey) |
protected Future<?> |
doFindByPrimaryKeyForFuture(Object parentKey,
ID simpleKeys) |
protected Future<?> |
doPersistCoreForFuture(android.content.ContentValues core) |
protected Future<List<Long>> |
doPersistCoreForFuture(Iterable<android.content.ContentValues> entities) |
protected Iterable<T> |
doQueryByPrimaryKeys(Object parentKey,
Iterable<ID> simpleKeys) |
void |
dropTable() |
protected List<T> |
findBy(Filter... filters) |
protected List<T> |
findBy(String orderBy,
boolean ascending,
int limit,
int offset,
Long parentKey,
Filter... filters) |
protected static <T,ID extends Serializable> |
findBy(TypeDaoImpl<T,ID> dao,
String orderBy,
boolean ascending,
int limit,
int offset,
Long parentKey,
Filter... filters) |
protected T |
findUniqueBy(Filter... filters) |
protected ID |
findUniqueKeyBy(Filter... filters) |
protected Object |
getCoreProperty(android.content.ContentValues core,
String name,
Class domainPropertyClass) |
protected String |
getDataType(String className) |
protected String |
getDataType(String className,
boolean isPrimaryKey) |
protected android.database.sqlite.SQLiteDatabase |
getDbConnection() |
protected Object |
getFromCursor(String columnName,
CursorIterable cursor) |
String |
getKeyString(Object key) |
Object |
getParentKey(Map<String,String> properties) |
Object |
getParentKey(T domain) |
Object |
getParentKeyByPrimaryKey(Object primaryKey) |
Object |
getPrimaryKey(String keyString) |
Object |
getPrimaryKey(T domain) |
void |
onCreate(android.database.sqlite.SQLiteDatabase sqldb) |
void |
onUpgrade(android.database.sqlite.SQLiteDatabase sqldb,
int fromVersion,
int toVersion) |
Collection<ID> |
persist(Iterable<T> domains)
Overriding this method to save heap, as Android have no real batch-persist method.
|
ID |
persist(T domain)
Override to avoid Iterable behavior in vain
|
protected Long |
persistCore(android.content.ContentValues core) |
protected Long |
persistCore(android.content.ContentValues core,
android.database.sqlite.SQLiteDatabase dbCon) |
protected Collection<Long> |
persistCore(Iterable<android.content.ContentValues> itrbl) |
protected void |
println(int priority,
String format,
Object... args) |
protected void |
printStackTrace(int priority,
String message,
Throwable t) |
static void |
putLong(String columnName,
CursorIterable cursor,
android.content.ContentValues core) |
static void |
putString(String columnName,
CursorIterable cursor,
android.content.ContentValues core) |
protected Iterable |
queryIterable(boolean keysOnly,
int limit,
int offset,
Object ancestorKey,
Object primaryKey,
String orderBy,
boolean ascending,
String secondaryOrderBy,
boolean secondaryIsAscending,
Filter... filters) |
protected Iterable<ID> |
queryIterableKeys(int offset,
int limit,
Object ancestorKey,
Object primaryKey,
String primaryOrderBy,
boolean primaryIsAscending,
String secondaryOrderBy,
boolean secondaryIsAscending,
Filter... filters) |
protected CursorPage<T,ID> |
queryPage(boolean keysOnly,
int pageSize,
Object ancestorKey,
Object primaryKey,
String primaryOrderBy,
boolean primaryIsAscending,
String secondaryOrderBy,
boolean secondaryIsAscending,
String cursorString,
Filter... filters) |
protected void |
releaseDbConnection() |
protected void |
setCoreProperty(Object core,
String name,
Object value) |
static void |
setDatabaseHelper(AbstractDatabaseHelper databaseHelper) |
protected void |
setDomainFromCursor(T domain,
String columnName,
CursorIterable cursor) |
void |
update(Iterable<T> domains) |
void |
update(T domain) |
protected Long |
updateByCore(android.content.ContentValues entity) |
protected Long |
updateByCore(android.content.ContentValues entity,
android.database.sqlite.SQLiteDatabase dbCon) |
protected List<Long> |
updateByCore(Iterable<android.content.ContentValues> entities) |
protected CursorPage<ID,ID> |
whatsDeleted(Date since,
int pageSize,
String cursorKey) |
_setCreatedBy, _setCreatedDate, _setUpdatedBy, _setUpdatedDate, copyCorePropertyToDomain, copyDomainPropertyToCore, coreKeysToSimpleKeys, coresToSimpleKeys, coreToDomain, count, createDomain, createDomain, createDomain, createDomain, createMemCacheKeyAll, createMemCacheKeys, debug, debug, delete, delete, delete, delete, delete, domainPageToSimplePage, domainsToPrimaryKeys, domainsToSimpleKeys, domainToCore, error, error, escapeCsv, findByPrimaryKey, findByPrimaryKey, findByPrimaryKey, findByPrimaryKeyForFuture, findByPrimaryKeyForFuture, findByPrimaryKeyForFuture, findNearest, getBasicColumnNames, getCachedByPrimaryKey, getCreatedBy, getCreatedByColumnName, getCreatedDate, getCreatedDateColumnName, getCsvColumnValues, getDomain, getDomainProperties, getDomainProperty, getGeoboxesColumnName, getGeoLocation, getGeoLocationColumnName, getManyToOneColumnNames, getManyToOneDao, getMemCache, getParentKeyColumnName, getPrimaryKey, getPrincipalName, getSimpleKey, getSimpleKey, getSimpleKeyByPrimaryKey, getSimpleKeys, getSimpleKeys, getTableName, getUpdatedBy, getUpdatedByColumnName, getUpdatedDate, getUpdatedDateColumnName, info, info, parseProperty, persistForFuture, persistForFuture, putCachedByPrimaryKey, queryAll, queryAll, queryAllKeys, queryAllKeys, queryByPrimaryKeys, queryChunk, queryInGeobox, queryPage, queryPage, setBoxBits, setDomainProperty, setDomainStringProperty, setMapProperty, setMardaoParentDao, setMemCacheConfig, setParentKey, setPrincipalName, updateGeoModel, updateMemCache, updateMemCache, updateMemCache, updateMemCacheAll, warn, warn, whatsChanged, whatsChanged, writeAsCsv, writeAsCsv, writeAsCsvclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetColumnClass, getColumnNames, getPrimaryKeyColumnName, getSimpleKey, setSimpleKeypublic static final SimpleDateFormat SDF
protected final String TAG
protected static final String OPERATION_IN
protected static AbstractDatabaseHelper databaseHelper
protected final android.database.sqlite.SQLiteDatabase.CursorFactory cursorFactory
protected int minLogPriority
protected static final Properties DATA_TYPES_DEFAULT
protected void println(int priority,
String format,
Object... args)
println in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected void printStackTrace(int priority,
String message,
Throwable t)
printStackTrace in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected final android.database.sqlite.SQLiteDatabase getDbConnection()
protected final void releaseDbConnection()
protected static String appendWhereFilters(ArrayList<String> sArgs, Filter... filters)
protected ID coreToSimpleKey(android.content.ContentValues core)
coreToSimpleKey in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected ID coreKeyToSimpleKey(Long core)
coreKeyToSimpleKey in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Long coreToParentKey(android.content.ContentValues core)
coreToParentKey in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Long coreKeyToParentKey(Long core)
coreKeyToParentKey in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected int count(Object ancestorKey, Object simpleKey, Filter... filters)
count in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected android.content.ContentValues createCore(Object primaryKey)
createCore in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected android.content.ContentValues createCore(Object parentKey, ID simpleKey)
createCore in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Long createCoreKey(Object parentKey, ID simpleKey)
createCoreKey in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>public static void putString(String columnName, CursorIterable cursor, android.content.ContentValues core)
public static void putLong(String columnName, CursorIterable cursor, android.content.ContentValues core)
protected Object getFromCursor(String columnName, CursorIterable cursor)
protected void setDomainFromCursor(T domain, String columnName, CursorIterable cursor)
public T createDomain(CursorIterable cursor) throws InstantiationException, IllegalAccessException
cursor - InstantiationExceptionIllegalAccessExceptionprotected String createMemCacheKey(Object parentKey, ID simpleKey)
createMemCacheKey in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>public Filter createGreaterThanOrEqualFilter(String columnName, Object value)
public Filter createInFilter(String fieldName, Collection param)
public int deleteAll()
protected int doDelete(Object parentKey, Iterable<ID> simpleKeys)
doDelete in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected int doDelete(Iterable<T> domains)
doDelete in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>public void dropTable()
dropTable in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected T doFindByPrimaryKey(Object parentKey, ID simpleKey)
doFindByPrimaryKey in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Future<?> doFindByPrimaryKeyForFuture(Object parentKey, ID simpleKeys)
doFindByPrimaryKeyForFuture in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Future<List<Long>> doPersistCoreForFuture(Iterable<android.content.ContentValues> entities)
doPersistCoreForFuture in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Future<?> doPersistCoreForFuture(android.content.ContentValues core)
doPersistCoreForFuture in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Iterable<T> doQueryByPrimaryKeys(Object parentKey, Iterable<ID> simpleKeys)
doQueryByPrimaryKeys in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected T findUniqueBy(Filter... filters)
findUniqueBy in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected ID findUniqueKeyBy(Filter... filters)
findUniqueKeyBy in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Object getCoreProperty(android.content.ContentValues core, String name, Class domainPropertyClass)
getCoreProperty in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>public Object getParentKey(Map<String,String> properties)
getParentKey in interface Dao<T,ID extends Serializable>getParentKey in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Collection<Long> persistCore(Iterable<android.content.ContentValues> itrbl)
persistCore in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>public ID persist(T domain)
persist in interface Dao<T,ID extends Serializable>persist in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>domain - public Collection<ID> persist(Iterable<T> domains)
persist in interface Dao<T,ID extends Serializable>persist in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>domains - protected CursorPage<T,ID> queryPage(boolean keysOnly, int pageSize, Object ancestorKey, Object primaryKey, String primaryOrderBy, boolean primaryIsAscending, String secondaryOrderBy, boolean secondaryIsAscending, String cursorString, Filter... filters)
queryPage in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Iterable<ID> queryIterableKeys(int offset, int limit, Object ancestorKey, Object primaryKey, String primaryOrderBy, boolean primaryIsAscending, String secondaryOrderBy, boolean secondaryIsAscending, Filter... filters)
queryIterableKeys in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected void setCoreProperty(Object core, String name, Object value)
setCoreProperty in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected CursorPage<ID,ID> whatsDeleted(Date since, int pageSize, String cursorKey)
whatsDeleted in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>public void update(Iterable<T> domains)
update in interface Dao<T,ID extends Serializable>update in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>public void update(T domain)
update in interface Dao<T,ID extends Serializable>update in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected List<T> findBy(String orderBy, boolean ascending, int limit, int offset, Long parentKey, Filter... filters)
protected static <T,ID extends Serializable> List<T> findBy(TypeDaoImpl<T,ID> dao, String orderBy, boolean ascending, int limit, int offset, Long parentKey, Filter... filters)
public void onCreate(android.database.sqlite.SQLiteDatabase sqldb)
public void onUpgrade(android.database.sqlite.SQLiteDatabase sqldb,
int fromVersion,
int toVersion)
protected Long persistCore(android.content.ContentValues core)
protected Long persistCore(android.content.ContentValues core, android.database.sqlite.SQLiteDatabase dbCon)
protected Iterable queryIterable(boolean keysOnly, int limit, int offset, Object ancestorKey, Object primaryKey, String orderBy, boolean ascending, String secondaryOrderBy, boolean secondaryIsAscending, Filter... filters)
queryIterable in class DaoImpl<T,ID extends Serializable,Long,CursorIterable,android.content.ContentValues,Long>protected Long updateByCore(android.content.ContentValues entity)
protected Long updateByCore(android.content.ContentValues entity, android.database.sqlite.SQLiteDatabase dbCon)
protected String createTable()
protected void appendParentKeyColumnDefinition(StringBuffer sql)
protected void appendColumnDefinition(StringBuffer sql, String columnName, boolean isPrimaryKey)
protected void appendColumnDefinition(StringBuffer sql, String columnName)
protected void appendConstraints(StringBuffer sql)
protected void appendConstraint(StringBuffer sql, String columnName, DaoImpl foreignDao)
public static void setDatabaseHelper(AbstractDatabaseHelper databaseHelper)
Copyright © 2013. All Rights Reserved.