Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Room Persistence library entity with AutoValue

Is it possible to use both Room persistence library's @Entity with AutoValue's @AutoValue and builder on the same POJO? How should i do it?

like image 523
Weizhi Avatar asked Jul 02 '17 09:07

Weizhi


People also ask

What is room persistence library?

The Room persistence library provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite. In particular, Room provides the following benefits: Compile-time verification of SQL queries.

What is Androidx room?

room. Kotlin |Java. Room is a Database Object Mapping library that makes it easy to access database on Android applications. Rather than hiding the details of SQLite, Room tries to embrace them by providing convenient APIs to query the database and also verify such queries at compile time.


2 Answers

This feature will be available in Room 2.1.0 https://issuetracker.google.com/issues/62408420#comment27

like image 169
reinaldomoreira Avatar answered Sep 23 '22 14:09

reinaldomoreira


AFAIK, as of 1.0.0-alpha3, this is not possible. Room wants fields; AutoValue doesn't expose fields. Keep tabs on this feature request for progress in this area.

like image 42
CommonsWare Avatar answered Sep 21 '22 14:09

CommonsWare