Fixed
Status Update
Comments
fa...@gmail.com <fa...@gmail.com> #2
I should probably elaborate on that a bit more here :P. The ideal case would be that data classes written in other modules work the same when consumed. A standard data class (no secondary constructors, `val` properties) works fine when in the same module. The errors produced are also pretty confusing. They'll usually give what they read from the bytecode (constructor params called "var0" or the like) and reports missing setters for fields without names of said fields.
yb...@google.com <yb...@google.com> #3
I can confirm the bug and the workaround. The same problem arises when you use a data-class from a library with @Embedded
yb...@google.com <yb...@google.com> #5
given that log, looks like kotlin again not generating proper parameter names for methods.
yb...@google.com <yb...@google.com>
sh...@google.com <sh...@google.com>
sh...@google.com <sh...@google.com>
sh...@gmail.com <sh...@gmail.com> #6
so turns out this is not about kotlin.
does not work w/ javac either because parameter names are not part of the class signature unless compiled w/ debug.
We will need to add a new annotation to support this.
does not work w/ javac either because parameter names are not part of the class signature unless compiled w/ debug.
We will need to add a new annotation to support this.
em...@gmail.com <em...@gmail.com> #7
True on the javac bit, but for kotlin you should be able to read the parameter names from the `@Metadata` annotations (since the param names are part of the public API in kotlin). There's no public API around this today though admittedly :/
Description
Version used: 1.0.0-alpha2
Devices/Android versions reproduced on: Emulator 26
Room with LiveData throws exception on "WITH" clause. I think LiveData tries to register on the name of WITH clause as if it is a table. Same SQL query works with Room without LiveData.
SQL query:
WITH split(i,l,c,r) AS (
SELECT book.bookId, 1, author||'|', '' FROM book
UNION ALL
SELECT i,
instr(c,'|') AS vLen,
substr(c,instr(c,'|')+1) AS vRem,
substr(c,1,instr(c,'|')-1) AS vCSV
FROM split
WHERE vLen>0
)
SELECT DISTINCT split.r FROM book , split
WHERE book.bookId=split.i AND split.r<>''
ORDER BY split.r
Table example:
CREATE TABLE book (
bookId INTEGER PRIMARY KEY,
author TEXT
);
INSERT INTO book (author) VALUES
('|A||B||C|'),
('|A||D|'),
('|B||D|');
Exception:
FATAL EXCEPTION: pool-2-thread-1
Process: tr.name.fatihdogan.books.debug, PID: 15674
java.lang.IllegalArgumentException: There is no table with name split
at android.arch.persistence.room.InvalidationTracker.addObserver(InvalidationTracker.java:228)
at android.arch.persistence.room.InvalidationTracker.addWeakObserver(InvalidationTracker.java:255)
at tr.name.fatihdogan.books.repository.BookDao_Impl$7.compute(BookDao_Impl.java:621)
at tr.name.fatihdogan.books.repository.BookDao_Impl$7.compute(BookDao_Impl.java:609)
at android.arch.lifecycle.ComputableLiveData$2.run(ComputableLiveData.java:87)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)