https://kotlinlang.org logo
Title
b

blakelee

05/21/2017, 3:11 PM
The new room persistence is annoying in kotlin :( hooray for kotlin/java interoperability
d

david.bilik

05/21/2017, 3:12 PM
blakelee: why its annoying? I am thinking about using it on my next project
b

blakelee

05/21/2017, 3:17 PM
Kotlin renames parameters when compiled so it makes the annotation processing weird. To get a query to work, you have to do something like this
@Query("SELECT * FROM table WHERE name = :p0")
fun getByName(name : String) : SomeType
I also don't think TypeConverters work yet for it either. Messed around with it all night yesterday. However, one or two classes in Java isn't so bad. Might only need the dao in Java
k

kingsley

05/21/2017, 7:58 PM
Are you using the
kotlin-kapt
plugin? IIRC it works well with parameter names.
l

lfielke

05/22/2017, 12:15 AM
There's an issue for this, targeted for 1.1.3: https://youtrack.jetbrains.com/issue/KT-17959