-
Notifications
You must be signed in to change notification settings - Fork 16
Annotations
xcesco edited this page Nov 28, 2017
·
14 revisions
The binding rules are defined through Java annotations. In this section there's a brief description of annotations defined in Kripton.
You can decorate both class and field with generic and specific-format annotation. At class declaration's level it's possible to use the following annotation:
-
@BindType: allows to Kripton to manage a POJO. Given a class
{name}
generate a{name}BindMap
class.. - @BindTable (Android platform): allows to customize table generation associated to class.
- @BindSharedPreferences (Android platform): allow to create a Shared Preference linked to annotated Java class.
Kripton decorate interface to create SQLite database, DAO, content provider and SharedPreference.
- @BindDataSource (Android platform): defines a data source based on SQLite database.
- @BindDao (Android platform): defines a DAO to manage a specific database's table.
- @BindContentProvider: used to generated a content provider starting from data source declaration. Given an interface DataSource, it will generate ContentProvider class.
- @BindContentProviderEntry: allow to use a specific DAO method in the generated content provider implementation.
You can decorate only fields. No setter or getter annotation is defined. You can decorate field regardless its accessor. The annotations are:
- @Bind: allow to customize field’s persistence on file system.
- @BindDisabled: disable field’s persistence.
-
@BindAdapter: allow to define which TypeAdapter use for a specific field. For example,
@BindAdapter
can be used to persit aDate
field as along
. - @BindXml: contains informations about xml-persistence of field. It make possible to define how transform field in xml: tag, attribute or value of parent tag.
- @BindColumn: allows to customize field persistence as table’s column.
- @BindPreference: to customize field persistence as preference.
There are some interface method's annotations:
- @BindSqlSelect: bind a DAO interface’s method to a SELECT SQL statement.
- @BindSqlInsert: bind a DAO interface’s method to an INSERT SQL statement.
- @BindSqlUpdate: bind a DAO interface’s method to an UPDATE SQL statement.
- @BindSqlDelete: bind a DAO interface’s method to a DELETE SQL statement.
- @BindContentProviderPath: allow to specify path in a content provider path for a DAO.
There is only one annotations that you can use on method parameters:
- @BindSqlParam: allow to define SQL parameter name.
- @BindSqlDynamicWhere: allow to use a DAO’s method parameter as dynamic part of where clauses in SQL associated to method.
- @BindSqlDynamicWhereParams: allow to use a DAO’s method parameter as dynamic parameters of where clauses in SQL associated to method.
- @BindSqlDynamicOrderBy: allows to use a DAO’s method parameter as dynamic part of order by clauses in SQL associated to method.
- @BindSqlPageSize: marks a parameter as pageSize for SQL results.
- Introduction
- Goals & Features
- Kotlin
- Immutable or Mutable Pojo
- Annotation Processor Args
- Credits
- Articles
- Benchmarks
- Setup
- Tutorial
- Usage
- Dependencies and inspirations
- Stackoverflow
- Documentation
- SQL logging
- Data source options
- Indices
- SQL Type adapter
- Global SQL Type adapter
- Constraints
- Live data: welcome Architectural components!!
- Paged Live data
- Dynamic parts
- Transactional and batch operations
- Async Transactional and batch operations
- Global transaction
- Support for immutable POJO
- Generate Content provider
- Generate Database schema generation
- Database migration
- BindSqlColumn
- BindContentProvider
- BindContentProviderEntry
- BindContentProviderPath
- BindDao
- BindDaoMany2Many
- BindDataSource
- BindDataSourceOptions
- BindDataSourceUpdateTask
- BindIndex
- BindSqlRelation
- BindSqlAdapter
- BindSqlChildSelect
- BindSqlDelete
- BindSqlDynamicOrderBy
- BindSqlDynamicWhere
- BindSqlDynamicWhereParams
- BindSqlInsert
- BindSqlPageSize
- BindSqlParam
- BindSqlSelect
- BindSqlUpdate
- BindSqlType
- BindSqlTransaction