Skip to content

Commit

Permalink
Merge pull request #1425 from Raizlabs/develop
Browse files Browse the repository at this point in the history
4.1.1
  • Loading branch information
agrosner authored Aug 31, 2017
2 parents bc1cf60 + 3788b8d commit 7071f42
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Image](https://github.com/agrosner/DBFlow/blob/develop/dbflow_banner.png?raw=true)

[![JitPack.io](https://img.shields.io/badge/JitPack.io-4.1.0-red.svg?style=flat)](https://jitpack.io/#Raizlabs/DBFlow) [![Android Weekly](http://img.shields.io/badge/Android%20Weekly-%23129-2CB3E5.svg?style=flat)](http://androidweekly.net/issues/issue-129) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-DBFlow-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1134)
[![JitPack.io](https://img.shields.io/badge/JitPack.io-4.1.1-red.svg?style=flat)](https://jitpack.io/#Raizlabs/DBFlow) [![Android Weekly](http://img.shields.io/badge/Android%20Weekly-%23129-2CB3E5.svg?style=flat)](http://androidweekly.net/issues/issue-129) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-DBFlow-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1134)

A robust, powerful, and very simple ORM android database library with **annotation processing**.

Expand Down Expand Up @@ -43,7 +43,7 @@ Add the library to the project-level build.gradle, using the apt plugin to enabl
apply plugin: 'kotlin-kapt' // required for kotlin.
def dbflow_version = "4.1.0"
def dbflow_version = "4.1.1"
// 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class OneToMany<T : Any>(private val query: () -> ModelQueriable<T>) : ReadWrite
private var list: List<T>? = null

override fun getValue(thisRef: Any, property: KProperty<*>): List<T>? {
if (list?.isEmpty() ?: true) {
if (list?.isEmpty() != false) {
list = query().list
}
return list
Expand Down
8 changes: 4 additions & 4 deletions dbflow-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8

dependencies {
implementation project("${dbflow_project_prefix}dbflow-core")
implementation 'com.squareup:javapoet:1.9.0'
implementation 'com.github.agrosner:KPoet:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile project("${dbflow_project_prefix}dbflow-core")
compile 'com.squareup:javapoet:1.9.0'
compile 'com.github.agrosner:KPoet:1.0.0'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"

compileOnly 'org.glassfish:javax.annotation:10.0-b28'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ class SqliteStatementAccessCombiner(combiner: Combiner)
statement("statement.bind$statementMethod($offset, $defaultValue)")
}
} else {
statement("statement.bind${wrapperMethod}OrNull($offset, $subWrapperFieldAccess)")
if (subWrapperAccessor != null) {
statement("statement.bind${wrapperMethod}OrNull($offset, $fieldAccess != null ? $subWrapperFieldAccess : null)")
} else {
statement("statement.bind${wrapperMethod}OrNull($offset, $subWrapperFieldAccess)")
}

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class OrderCursorModel(@PrimaryKey var id: Int = 0, @Column var name: String? =

@Table(database = TestDatabase::class)
class TypeConverterModel(@PrimaryKey var id: Int = 0,
@Column(typeConverter = BlobConverter::class) var opaqueData: ByteArray? = null,
@Column var blob: Blob? = null,
@Column(typeConverter = CustomTypeConverter::class)
@PrimaryKey var customType: CustomType? = null)
Expand Down Expand Up @@ -156,6 +157,18 @@ class CustomEnumTypeConverter : TypeConverter<String, Difficulty>() {

}

@com.raizlabs.android.dbflow.annotation.TypeConverter
class BlobConverter : TypeConverter<Blob, ByteArray>() {

override fun getDBValue(model: ByteArray?): Blob? {
return if (model == null) null else Blob(model)
}

override fun getModelValue(data: Blob?): ByteArray? {
return data?.blob
}
}

@Table(database = TestDatabase::class)
class DefaultModel(@PrimaryKey @Column(defaultValue = "5") var id: Int? = 0,
@Column(defaultValue = "5.0") var location: Double? = 0.0,
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=4.0.5
version=4.1.1
version_code=1
group=com.raizlabs.android
bt_siteUrl=https://github.com/Raizlabs/DBFlow
Expand Down

0 comments on commit 7071f42

Please sign in to comment.