2.2.0-alpha02
https://developer.android.com/jetpack/androidx/releases/room#2.2.0-alpha02
Version 2.2.0-alpha02
August 7, 2019
androidx.room:room-*:2.2.0-alpha02 is released. The commits included in this version can be found here.
New Features
- Coroutines Flow: @query DAO methods can now be of return type Flow.
The returned Flow will re-emit a new set of values if the observing tables in
the query are invalidated. Declaring a DAO function with a Channel return
type is an error, Room instead encourages you to use Flow and then use the
neighboring functions to convert the Flow into a Channel.
b/130428884 - Expanding Projections: A new experimental compiler option
room.expandProjection was added that causes Room to rewrite a query with
a star projection to only contain the columns in the returning type POJO. For
example, for a DAO method with @query("SELECT * FROM Song) that returns a
POJO named SongIdAndTitle with only two fields. Then Room will rewrite the
query to SELECT id, title FROM Song such that the minimum set of columns
to satisfy the return type are fetched. This essentially eliminates the
CURSOR_MISMATCH warning that is presented when the query returns extra
columns that do not match any field in the returning POJO type. - onDestructiveMigrate is a new callback API added to RoomDatabase.Callback
for when Room destructively migrates a database.
b/79962330
Bug Fixes
- Fixed a bug where Room would generate incorrect code using a method as field
setter when the field is protected.
b/136194628 - Fixed a bug that caused the InvalidationTracker to throw a NPE in a second
process when multi-instance invalidation was enabled and the invalidation
Service was killed.
b/137454915 - Fixed a bug where Room would not correctly identify the return type of an
inherited suspend function annotated with @rawquery.
b/137878827 - Updated the generated code for @relation when the relating key is of type
BLOB to use a ByteBuffer that is comparable.
b/137881998 - Fixed a bug where Room would complain about missing setters on POJOs used as
partial entity parameters of @insert, @update and @delete.
b/138664463 - Fixed a bug where Room would complain about missing getters & setters for an
ignored column via @entity when the entity class was used in certain DAO
methods.
b/138238182 - Fixed a bug where Room would not correctly convert named binding args to
positional args causing a runtime exception when executing a query with
re-used parameters.
b/137254857