Releases: androidx-releases/Room
Release list
2.3.0-alpha03
2.2.3
2.2.2
2.2.1
2.2.0-rc01
https://developer.android.com/jetpack/androidx/releases/room#2.2.0-rc01
Version 2.2.0-rc01
September 5, 2019
androidx.room:room:2.2.0-rc01 is released. The commits included in this version can be found here.
No public changes since Room 2.2.0-beta01.
2.2.0-beta01
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
2.2.0
2.2.0-alpha01
https://developer.android.com/jetpack/androidx/releases/room#2.2.0-alpha01
Version 2.2.0-alpha01
July 10, 2019
New Features
-
Pre-packaged Database: Two new APIs in RoomDatabase.Builder are now
available for creating a RoomDatabase given an already populated database
file. createFromAsset() is for when the pre-populated database file is in
the assets folder of the APK, while createFromFile() is for when the file is
in an arbitrary location. The usages of these API change the behaviour of
destructive migrations such that during a fallback migration, Room will try
to re-copy the pre-populated database if available, otherwise it fallbacks to
just dropping and re-creating all tables.
b/62185732 -
Schema Default Values: @ColumnInfo now has a new property defaultValue
that can be used to specify the default value of a column. Default values are
part of a database schema and will be validated during migrations if
specified. b/64088772
Note: If your database schema already has default
values, such as those added via ALTER TABLE x ADD COLUMN y INTEGER NOTNULL
DEFAULT z, and you decide to define default values via @ColumnInfo to the
same columns, then you might need to provide a migration to validate the
unaccounted default values. See
Room Migrations
for more information. -
Many-to-Many Relations: @relation now has a new property associateBy,
that takes in a new annotation @junction, used to declare a relation that
needs to be satisfied via a junction table (also known as a join table).
b/69201917 -
One-to-One Relations: The restriction in POJO fields annotated with
@relation to be of type List or Set has been lifted, effectively
allowing single-value relations to be represented.
b/62905145 -
Target Entity: The DAO annnotations @insert, @update and @delete now
has a new property targetEntity, that allows specifying the target table the
DAO method is meant to act on. This allows for the parameters of those DAO
methods to be arbitrary POJOs which will be interpreted as partial entities.
In practice, this allows partial inserts, deletes and updates.
b/127549506 -
Gradle Incremental Annotation Processor: Room is now a Gradle isolating
annotation processor and incrementability can be enabled via the processor
option room.incremental. See
Room Compiler Options
for more information. If you encounter any issues please file a
bug here.
We plan to enable incrementability by default in a future, stable version.
b/112110217
Bug Fixes
- Room will no longer propagate the EmptySetResultException to the
global error handler when the Rx stream of a query has been disposed before
the query is complete.
b/130257475 - Fixed a bug where Room would show an incorrect error message when a suspend
DAO function annotated with @rawquery didn't have a return type.
b/134303897 - Room will no longer generate DAO adapters with raw types.
b/135747255