Fixed
Status Update
Comments
ng...@gmail.com <ng...@gmail.com> #2
fl...@google.com <fl...@google.com>
yb...@google.com <yb...@google.com> #3
> We accept pull requests! :)
Is there a public repo somewhere? I don't see any obvious repo for it inhttps://android.googlesource.com , and it doesn't seem to be inside https://android.googlesource.com/platform/frameworks/support .
Room supports final fields (yay!), which probably will suffice for many people with respect to this feature request.
Is there a public repo somewhere? I don't see any obvious repo for it in
Room supports final fields (yay!), which probably will suffice for many people with respect to this feature request.
th...@gmail.com <th...@gmail.com> #4
Room supports immutability (it can use arg constructors) but does not directly support AutoValue. It is in the schedule but not high priority :/. Idk much about its internals at this stage so I'm not sure how we would implement it but should be totally doable.
Sorry we don't have the source release yet :/.
Sorry we don't have the source release yet :/.
fl...@google.com <fl...@google.com> #5
"It is in the schedule but not high priority" -- completely understandable.
"Sorry we don't have the source release yet :/." -- ah, OK, I thought perhaps with the pull request comment, that meant that there was a repo somewhere that I had overlooked.
Thanks!
"Sorry we don't have the source release yet :/." -- ah, OK, I thought perhaps with the pull request comment, that meant that there was a repo somewhere that I had overlooked.
Thanks!
ng...@gmail.com <ng...@gmail.com> #6
Add autovalue support also means you can easily achieve parcelable by https://github.com/rharter/auto-value-parcel . Please consider support this.
ap...@google.com <ap...@google.com> #7
AutoValue is really a handy way to ensure data integrity.
fl...@google.com <fl...@google.com> #8
Please add AutoValue support. AutoValue is a Google library with really good benefits such as toString() , hashCode() , AutoValue.Builder , checks at creation time if @NonNull values are null, etc.
da...@google.com <da...@google.com> #9
FWIW, issue 64206877 is not publicly accessible.
Description
Version used: 2.1.0-alpha01
Devices/Android versions reproduced on: Nexus 5 (Android 6.0.1) and Emulator (Android 8)
Android Studio 3.3 Canary 13
I create this DAO
import androidx.room.*
import dominando.android.data_room.entity.Book
import io.reactivex.Completable
import io.reactivex.Flowable
import io.reactivex.Maybe
@Dao
interface BookDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun save(book: Book): Completable
@Delete
fun delete(vararg book: Book): Completable
@Query("SELECT * FROM Book WHERE title LIKE :title ORDER BY title")
fun bookByTitle(title: String = "%"): Flowable<List<Book>>
@Query("SELECT * FROM Book WHERE id = :id")
fun bookById(id: String): Maybe<Book>
}
But compilation fails with this error.
error: local variable book is accessed from within inner class; needs to be declared final
When I look to the generated code, this is it.
@Override
public Completable save(Book book) {
return Completable.fromCallable(new Callable() {
@Override
public Void call() throws Exception {
__db.beginTransaction();
try {
__insertionAdapterOfBook.insert(book);
__db.setTransactionSuccessful();
return null;
} finally {
__db.endTransaction();
}
}
});
}
As you can see, book parameter is not marked as final and cannot be accessed inside of Completable.fromCallable.