Modifier and Type | Class and Description |
---|---|
class |
KittyDatabase<M extends KittyModel>
Abstract class to be used with KittyKitty sqlite
Child must be annotated with
KITTY_DATABASE annotation. |
class |
KittyMMEntry<M extends KittyModel,D extends KittyMapper>
Created by akaish on 14.11.17.
|
Modifier and Type | Field and Description |
---|---|
protected KittyModel |
KittyMapper.blankModelInstance
Blank model to be used with this mapper
|
(package private) M |
KittyMMEntry.model |
Modifier and Type | Method and Description |
---|---|
static <M extends KittyModel> |
PreparedStatementBinder.bindModelValuesToPreparedStatement(M model,
KittyTableConfiguration table,
android.database.sqlite.SQLiteStatement statement) |
<T extends KittyModel> |
KittyModel.clone(java.lang.Class<T> recordClass) |
protected <M extends KittyModel> |
KittyMapper.cloneModel(java.lang.Class<M> modelClass)
Clones blank model associated with this data mapper
|
static <M extends KittyModel> |
CVUtils.cursorToModel(boolean rowIDSupport,
android.database.Cursor cursor,
M model,
KittyTableConfiguration table)
Deprecated.
|
<M extends KittyModel> |
KittyModelCVFactory.cursorToModel(android.database.Cursor cursor,
M model,
boolean rowidOn)
Sets fields of provided instance of
KittyModel (modelClass) with values from provided Cursor according to
provided with this instance's KITTY_COLUMN annotations data wrapped into KittyColumnConfiguration instance. |
<M extends KittyModel> |
KittyMapper.delete(KittyMapper.TRANSACTION_MODES txMode,
java.util.List<M> models)
Deletes all rows that represented by provided model's list.
|
<M extends KittyModel> |
KittyMapper.delete(java.util.List<M> models)
Deletes all rows that represented by provided model's list.
|
<M extends KittyModel> |
KittyMapper.delete(M model)
Deletes row that represented by provided model.
|
<M extends KittyModel> |
KittyMapper.deleteInTransaction(java.util.List<M> models)
Deletes all rows that represented by provided model's list.
|
<M extends KittyModel> |
KittyMapper.findAll()
Returns list of all models associated with records in backed database table.
|
<M extends KittyModel> |
KittyMapper.findAll(QueryParameters qParams)
Returns list of all models associated with records in backed database table with usage of
passed qParams.
|
<M extends KittyModel> |
KittyMapper.findByIPK(java.lang.Long ipk)
Returns model filled with data from database or null if no record with provided IPK found.
|
<M extends KittyModel> |
KittyMapper.findByPK(KittyPrimaryKey primaryKey)
Returns model filled with data from database or null if no record with provided PK (
KittyPrimaryKey ) found. |
<M extends KittyModel> |
KittyMapper.findByPKV(java.util.Map<java.lang.String,java.lang.String> pkv)
Returns model filled with data from database or null if no record with provided PK MAP (
KittyPrimaryKey.getPrimaryKeyColumnValues() ) found. |
<M extends KittyModel> |
KittyMapper.findByRowID(java.lang.Long rowid)
Returns model filled with data from database or null if no record with provided rowid found.
|
<M extends KittyModel> |
KittyMapper.findFirst()
Returns first record in KittyModel wrapper in database table that suits provided condition.
|
<M extends KittyModel> |
KittyMapper.findFirst(SQLiteCondition where)
Returns first record in KittyModel wrapper in database table that suits provided condition.
|
<M extends KittyModel> |
KittyMapper.findFirst(java.lang.String condition,
java.lang.Object... conditionValues)
Returns first record in KittyModel wrapper in database table that suits provided condition.
|
<M extends KittyModel> |
KittyMapper.findLast()
Returns last record in KittyModel wrapper in database table that suits provided condition.
|
<M extends KittyModel> |
KittyMapper.findLast(SQLiteCondition where)
Returns last record in KittyModel wrapper in database table that suits provided condition.
|
<M extends KittyModel> |
KittyMapper.findLast(java.lang.String condition,
java.lang.Object... conditionValues)
Returns last record in KittyModel wrapper in database table that suits provided condition.
|
<M extends KittyModel> |
KittyMapper.findWhere(QueryParameters qParams,
java.lang.String condition,
java.lang.Object... conditionValues)
Returns list of models that suits provided condition string and query parameters.
|
<M extends KittyModel> |
KittyMapper.findWhere(SQLiteCondition where)
Returns list of models that suits provided conditions.
|
<M extends KittyModel> |
KittyMapper.findWhere(SQLiteCondition where,
QueryParameters qParams)
Returns list of models that suits provided conditions and query parameters.
|
<M extends KittyModel> |
KittyMapper.findWhere(java.lang.String condition,
java.lang.Object... conditionValues)
Returns list of models that suits provided condition string.
|
<M extends KittyModel> |
KittyMapper.findWithRawQuery(boolean rowIdSupport,
KittySQLiteQuery query)
Tries to fetch data from database table with provided query and wrap it into collection of models.
|
protected <M extends KittyModel> |
KittyDatabase.generateMMInstanceStorageFromRegistry(java.util.Map<java.lang.Class<M>,java.lang.Class<KittyMapper>> registry,
KittyMMEntryFactory entryFactory,
KittyDatabaseConfiguration databaseConfiguration) |
protected <M extends KittyModel> |
KittyMapper.getBlankModelInstance()
Creates new model via default constructor
You should rewrite it, I suppose, for better performance
cause it uses one more reflection magic piece,
however, you know, it makes model classes more pretty to look
also, if you are big fan of entropy and want to make
death of universe closer, you also can rewrite this method
for parametrized models with
Context for serializing
objects to be stored in databaseClass (you're sick!) |
protected <M extends KittyModel> |
KittyMapper.getInsertStatement(M model) |
<D extends KittyMapper,M extends KittyModel> |
KittyDatabase.getMapper(java.lang.Class<M> recordClass) |
<M extends KittyModel> |
KittyDatabase.getModel(java.lang.Class<M> recordClass) |
protected <M extends KittyModel> |
KittyMapper.getModelClass()
Returns model class associated with this mapper child
|
protected <M extends KittyModel> |
KittyMapper.getPKCondition(M model,
SQLiteCondition defaultCondition)
Returns PK condition for provided model, there are following steps:
If provided default condition not null, it would be returned. |
protected <M extends KittyModel> |
KittyMapper.getPrimaryKeyValuesForModel(M model)
Tries to return primary key values from provided model as map where keys are column names of PK
and values are string representations of PK's values from model's fields.
|
protected <M extends KittyModel> |
KittyMapper.getRowIDCondition(M model)
Creates condition "WHERE rowid = ?"
|
<M extends KittyModel> |
KittyMapper.insert(KittyMapper.TRANSACTION_MODES txMode,
java.util.List<M> models)
Inserts models in provided list into database table in new transaction. |
<M extends KittyModel> |
KittyMapper.insert(java.util.List<M> models)
Inserts models in provided list into database table.
|
<M extends KittyModel> |
KittyMapper.insert(M model)
Inserts into database provided model's values.
|
<M extends KittyModel> |
KittyMapper.insertInTransaction(java.util.List<M> models)
Inserts models in provided list into database table in internal method transaction started with
transaction mode
KittyMapper.TRANSACTION_MODES.EXCLUSIVE_MODE . |
protected <M extends KittyModel> |
KittyMapper.logModel(java.lang.String executor,
M model)
Logs model to log if logOn and !
|
static <M extends KittyModel> |
KittyMapper.logModel(java.lang.String executor,
M model,
java.lang.String logTag,
boolean logOn,
boolean productionOn,
java.lang.Object helper,
java.lang.String schemaName,
int schemaVersion)
Logs model to log depends on parameter flags
|
static <M extends KittyModel> |
CVUtils.modelToCV(M model,
KittyTableConfiguration table)
Generates
ContentValues instance from provided instance of KittyModel with usage
of KittyTableConfiguration configuration. |
static <M extends KittyModel> |
CVUtils.modelToCV(M model,
KittyTableConfiguration table,
java.lang.String[] names,
int skipOrInclude)
Generates
ContentValues instance from provided instance of KittyModel with usage
of KittyTableConfiguration configuration. |
(package private) static <D extends KittyMapper,M extends KittyModel> |
KittyMMEntryFactory.newKittyMapper(java.lang.Class<D> kittyDataMapperClass,
KittyTableConfiguration tableConfiguration,
KittyDatabaseConfiguration dbConfiguration,
M blankModel,
java.lang.String dbPassword)
Creates new KittyMapper from mapper class and other needed stuff
|
(package private) static <M extends KittyModel> |
KittyMMEntryFactory.newKittyModel(java.lang.Class<M> kittyModelClass)
Creates new KittyModel with provided modelClass class
|
<D extends KittyMapper,M extends KittyModel> |
KittyMMEntryFactory.newMMEntry(java.lang.Class<D> mapperClass,
KittyTableConfiguration tableCfg)
Creates MM entry for specified mapper class and with usage of current table configuration
|
<M extends KittyModel> |
KittyMapper.save(KittyMapper.TRANSACTION_MODES txMode,
java.util.List<M> models)
Saves values from provided list of models into database.
|
<M extends KittyModel> |
KittyMapper.save(java.util.List<M> models)
Saves values from provided list of models into database.
|
<M extends KittyModel> |
KittyMapper.save(M model)
Saves data from provided model into database table.
|
<M extends KittyModel> |
KittyMapper.saveInTransaction(java.util.List<M> models)
Saves values from provided list of models into database.
|
<M extends KittyModel> |
KittyMapper.update(KittyMapper.TRANSACTION_MODES txMode,
java.util.List<M> models)
Updates values in database with values from models from provided list in new transaction..
|
<M extends KittyModel> |
KittyMapper.update(java.util.List<M> models)
Update records from database with values from provided list of model.
|
<M extends KittyModel> |
KittyMapper.update(M model)
Update records from database with values from provided model.
|
<M extends KittyModel> |
KittyMapper.update(M model,
SQLiteCondition condition)
Update records from database with values from provided model that suits provided condition.
|
<M extends KittyModel> |
KittyMapper.update(M model,
SQLiteCondition condition,
java.lang.String[] names,
int IEFlag)
Update records from database with values from provided model that suits provided condition.
|
<M extends KittyModel> |
KittyMapper.update(M model,
java.lang.String[] names,
int IEFlag,
java.lang.String condition,
java.lang.Object... conditionValues)
See
KittyMapper.update(KittyModel, SQLiteCondition, String[], int) for more info |
<M extends KittyModel> |
KittyMapper.update(M model,
java.lang.String condition,
java.lang.Object... conditionValues) |
<M extends KittyModel> |
KittyMapper.updateInTransaction(java.util.List<M> models)
Updates rows in database with models from provided list in internal method transaction started with
transaction mode
KittyMapper.TRANSACTION_MODES.EXCLUSIVE_MODE . |
Modifier and Type | Method and Description |
---|---|
KittyModel |
KittyModel.clone() |
Modifier and Type | Class and Description |
---|---|
class |
KittyConfigurator<M extends KittyModel>
Simple abstract class to be used for reading databaseClass configurations
Created by akaish on 14.03.18.
|
Modifier and Type | Method and Description |
---|---|
static <T extends KittyModel> |
KittyAnnoColumnConfigurationUtil.generateAMColumnConfiguration(java.lang.reflect.Field field,
java.lang.Class<T> record,
java.lang.String schemaName,
java.lang.String tableName)
Returns KittyColumnConfiguration for provided field of modelClass
Returns null, if field not annotated with at least
KITTY_COLUMN |
static <T extends KittyDatabase,M extends KittyModel> |
KittyAnnoDatabaseConfigurationUtil.generateDatabaseConfiguration(java.lang.Class<T> database,
android.content.Context ctx,
java.util.Map<java.lang.Class<M>,java.lang.Class<KittyMapper>> registry) |
static <T extends KittyModel> |
KittyAnnoTableConfigurationUtil.generateTableConfiguration(java.lang.Class<T> modelClass,
java.lang.String schemaName)
Returns instance of
KittyTableConfiguration from Class extends KittyModel Model
annotated with KITTY_TABLE
Returns Null if provided class not annotated with KITTY_TABLE annotation May throw KittyRuntimeException if more than one PK declaration found or no columns defined in modelClass
Also may throw KittyRuntimeException with reasons related with KittyAnnoColumnConfigurationUtil.generateAMColumnConfiguration(Field, Class, String, String) |
Modifier and Type | Class and Description |
---|---|
class |
KittyDatabaseConfiguration<M extends KittyModel>
Configuration DAO for KittyDatabase implementation
Created by akaish on 13.02.18.
|
class |
KittyDatabaseConfigurationBuilder<M extends KittyModel>
Builder for
KittyDatabaseConfiguration |
Modifier and Type | Field and Description |
---|---|
java.lang.Class<? extends KittyModel> |
KittyTableConfiguration.modelClass |
Modifier and Type | Method and Description |
---|---|
<T extends KittyModel> |
KittyTableConfigurationBuilder.setModelClass(java.lang.Class<T> modelClass) |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<? extends KittyModel> |
KittyPrimaryKey.getModelClass() |
Modifier and Type | Method and Description |
---|---|
KittyPrimaryKeyBuilder |
KittyPrimaryKeyBuilder.setModelClass(java.lang.Class<? extends KittyModel> modelClass) |
Constructor and Description |
---|
KittyPrimaryKey(java.util.Map<java.lang.String,java.lang.String> primaryKeyColumnValues,
java.util.Map<java.lang.String,KittyPrimaryKeyPart> primaryKeyColumnKeyParts,
java.lang.String tableName,
java.lang.String databaseName,
java.lang.Class<? extends KittyModel> modelClass) |
Modifier and Type | Method and Description |
---|---|
static SQLiteCondition |
SQLiteConditionBuilder.fromSQL(java.lang.String conditionStr,
java.lang.Class<? extends KittyModel> modelClass,
java.lang.Object... params)
Generates
SQLiteCondition from SQLite string and provided params. |
Modifier and Type | Method and Description |
---|---|
static <T extends KittyModel> |
KittyNamingUtils.generateTableNameFromRecordName(java.lang.Class<T> model)
Returns generated name of table
1) Record and Model endings would be deleted 2) Camel case would be changes to lower_case_underscore |
static <M extends KittyModel> |
KittyReflectionUtils.getStringRepresentationOfModelField(M model,
java.lang.String fieldName)
Returns string representation of provided field for provided kitty model object if possible.
|