一个强大而又简单的ORM Android数据库,配有注释处理。
这个库是基于速度,性能和可适配度创建的。他不禁笑出了大多数用于处理数据库的boiler-plate代码,而且还提供了一个强大又简单的API来管理接口。
导入到项目中
allProjects {
repositories {
// required to find the project's artifacts
maven { url "https://www.jitpack.io" }
}
}
将这个库添加到项目级build.gradle,使用APT插件启动Annotation Processing:
def dbflow_version = "4.0.0-beta6"
// or dbflow_version = "develop-SNAPSHOT" for grabbing latest dependency in your project on the develop branch
// or 10-digit short-hash of a specific commit. (Useful for bugs fixed in develop, but not in a release yet)
dependencies {
annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
// use kapt for kotlin apt if you're a Kotlin user
kapt "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
// sql-cipher database encryption (optional)
compile "com.github.Raizlabs.DBFlow:dbflow-sqlcipher:${dbflow_version}"
compile "net.zetetic:android-database-sqlcipher:${sqlcipher_version}@aar"
// kotlin extensions
compile "com.github.Raizlabs.DBFlow:dbflow-kotlinextensions:${dbflow_version}"
// RXJava 1 support
compile "com.github.Raizlabs.DBFlow:dbflow-rx:${dbflow_version}"
// RXJava 1 Kotlin Extensions Support
compile "com.github.Raizlabs.DBFlow:dbflow-rx-kotlinextensions:${dbflow_version}"
// RXJava 2 support
compile "com.github.Raizlabs.DBFlow:dbflow-rx2:${dbflow_version}"
// RXJava 2 Kotlin Extensions Support
compile "com.github.Raizlabs.DBFlow:dbflow-rx2-kotlinextensions:${dbflow_version}"
}
// if you're building with Kotlin
kapt {
generateStubs = true
}