Skip to content

Commit 7071f42

Browse files
authored
Merge pull request #1425 from Raizlabs/develop
4.1.1
2 parents bc1cf60 + 3788b8d commit 7071f42

File tree

6 files changed

+27
-9
lines changed

6 files changed

+27
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Image](https://github.com/agrosner/DBFlow/blob/develop/dbflow_banner.png?raw=true)
22

3-
[![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)
3+
[![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)
44

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

@@ -43,7 +43,7 @@ Add the library to the project-level build.gradle, using the apt plugin to enabl
4343
4444
apply plugin: 'kotlin-kapt' // required for kotlin.
4545
46-
def dbflow_version = "4.1.0"
46+
def dbflow_version = "4.1.1"
4747
// or dbflow_version = "develop-SNAPSHOT" for grabbing latest dependency in your project on the develop branch
4848
// or 10-digit short-hash of a specific commit. (Useful for bugs fixed in develop, but not in a release yet)
4949

dbflow-kotlinextensions/src/main/java/com/raizlabs/android/dbflow/kotlinextensions/OneToManyExtensions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class OneToMany<T : Any>(private val query: () -> ModelQueriable<T>) : ReadWrite
1515
private var list: List<T>? = null
1616

1717
override fun getValue(thisRef: Any, property: KProperty<*>): List<T>? {
18-
if (list?.isEmpty() ?: true) {
18+
if (list?.isEmpty() != false) {
1919
list = query().list
2020
}
2121
return list

dbflow-processor/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ targetCompatibility = JavaVersion.VERSION_1_8
77
sourceCompatibility = JavaVersion.VERSION_1_8
88

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

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

dbflow-processor/src/main/java/com/raizlabs/android/dbflow/processor/definition/column/ColumnAccessCombiner.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,12 @@ class SqliteStatementAccessCombiner(combiner: Combiner)
182182
statement("statement.bind$statementMethod($offset, $defaultValue)")
183183
}
184184
} else {
185-
statement("statement.bind${wrapperMethod}OrNull($offset, $subWrapperFieldAccess)")
185+
if (subWrapperAccessor != null) {
186+
statement("statement.bind${wrapperMethod}OrNull($offset, $fieldAccess != null ? $subWrapperFieldAccess : null)")
187+
} else {
188+
statement("statement.bind${wrapperMethod}OrNull($offset, $subWrapperFieldAccess)")
189+
}
190+
186191
}
187192
}
188193
}

dbflow-tests/src/test/java/com/raizlabs/android/dbflow/models/SimpleTestModels.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class OrderCursorModel(@PrimaryKey var id: Int = 0, @Column var name: String? =
7878

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

157158
}
158159

160+
@com.raizlabs.android.dbflow.annotation.TypeConverter
161+
class BlobConverter : TypeConverter<Blob, ByteArray>() {
162+
163+
override fun getDBValue(model: ByteArray?): Blob? {
164+
return if (model == null) null else Blob(model)
165+
}
166+
167+
override fun getModelValue(data: Blob?): ByteArray? {
168+
return data?.blob
169+
}
170+
}
171+
159172
@Table(database = TestDatabase::class)
160173
class DefaultModel(@PrimaryKey @Column(defaultValue = "5") var id: Int? = 0,
161174
@Column(defaultValue = "5.0") var location: Double? = 0.0,

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=4.0.5
1+
version=4.1.1
22
version_code=1
33
group=com.raizlabs.android
44
bt_siteUrl=https://github.com/Raizlabs/DBFlow

0 commit comments

Comments
 (0)