The new room persistence is annoying in kotlin :( ...
# android
b
The new room persistence is annoying in kotlin :( hooray for kotlin/java interoperability
d
blakelee: why its annoying? I am thinking about using it on my next project
b
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
Copy code
@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
Are you using the
kotlin-kapt
plugin? IIRC it works well with parameter names.
l
There's an issue for this, targeted for 1.1.3: https://youtrack.jetbrains.com/issue/KT-17959