-
Notifications
You must be signed in to change notification settings - Fork 16
Kotlin Support
xcesco edited this page Sep 25, 2018
·
4 revisions
Since version 4.1.0, Kripton has an improved support for Kotlin language. If you want to use Kripton Persistence Library with Kotlin, just configure your project gradle config file to work with kapt
.
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
...
ext {
kriptonVersion = "5.0.0"
...
}
dependencies {
kapt "com.abubusoft:kripton-processor:${kriptonVersion}"
implementation "com.abubusoft:kripton-android-library:${kriptonVersion}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
...
}
With this configuration, it is possible to use Kripton Annotations in Kotlin source code.
@BindDao(Article::class)
interface DaoArticle : DaoBase<Article> {
@BindSqlUpdate(where = "id=:id")
fun update(id: Long, channelId: Long, read: Boolean)
@BindSqlSelect
fun selectByChannel(@BindSqlDynamicWhere where: String): LiveData<List<Article>>
@BindSqlSelect(where = "channelId=:channelId")
fun selectByChannelUd(channelId: Long): List<Article>
@BindSqlSelect(where = "channelId=:channelId AND guid=:guid")
fun selectByGuid(channelId: Long, guid: String): Article
}
- 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