• Home
  • History
  • Annotate
  • only in /frameworks/support/room/integration-tests/testapp/src/androidTest/java/
History log of /frameworks/support/room/integration-tests/testapp/src/androidTest/java/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7d2309c06787d20bafe9582e1f47d106b624ab59 22-May-2018 Yuichi Araki <yaraki@google.com> Fix flaking DataSourceFactoryTest

Test: DataSourceFactoryTest 50 times
Change-Id: Ice0743546381a18512616ce073d9963cdde6eb75
ndroidx/room/integration/testapp/paging/DataSourceFactoryTest.java
4ee553a06e6d9800123bb9463e77bc8554599ef2 11-May-2018 Yigit Boyar <yboyar@google.com> resolve merge conflicts of 8c7ba17f0a8d862f2de744e5bf5879a7e175927d to pi-preview1-androidx-dev

BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I8e651d666173fec59d64ec722b18572d6f28da91
8c7ba17f0a8d862f2de744e5bf5879a7e175927d 11-May-2018 Yigit Boyar <yboyar@google.com> Do not call onOpen if we'll close the db

This CL fixes a bug where we would call onOpen on a database that we
will close. This causes Room's invalidation tracker to be initialized
with a closed database, breaking all invalidation tracking post
migration.

Bug: 79362399
Test: JournalDbPostMigrationTest
Change-Id: I6bf7714717b731ac3c78dedef167fcc0795d46a0
ndroid/arch/persistence/room/integration/testapp/migration/JournalDbPostMigrationTest.java
fbdf0efb750162aa24df0f1a24c8420f1c780ac7 26-Apr-2018 Aurimas Liutikas <aurimas@google.com> Merge app-toolkit build into support library.

Test: ./gradlew buildOnServer
Change-Id: Id654438ed5726026cb3bec6047785bb0c67f158a
Merged-In: Id654438ed5726026cb3bec6047785bb0c67f158a
ndroidx/room/integration/testapp/migration/JournalDbPostMigrationTest.java
ndroidx/room/integration/testapp/test/WriteAheadLoggingTest.java
beda5774013b4e2ef1e2d445b867f7ede5603d42 25-Apr-2018 Yigit Boyar <yboyar@google.com> resolve merge conflicts of e04ae0342b521502855e61fe70eb3078e9380d4f to pi-preview1-androidx-dev

BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I26585d4395ce0ee524fa4338423d3a124cdec45c
e04ae0342b521502855e61fe70eb3078e9380d4f 25-Apr-2018 Yigit Boyar <yboyar@google.com> Merge "When a migration happens, re-open the database" into oc-mr1-jetpack-dev
f841d6b7490821ca9a843a673a89d41b266f280d 21-Apr-2018 Yigit Boyar <yboyar@google.com> When a migration happens, re-open the database

Bug: 78359448
Test: JournalDbPostMigrationTest
Change-Id: I1221315f49c38e95fddada543a0ec6a29f4b9747
ndroid/arch/persistence/room/integration/testapp/migration/JournalDbPostMigrationTest.java
39804378a0864f76c070670f4b16867c1fb491a9 24-Apr-2018 Yigit Boyar <yboyar@google.com> resolve merge conflicts of 53bd414cca00f4d7172b6caba513a477195bed47 to pi-preview1-androidx-dev

BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: If741ea2c57d4ac7516ced4c7e881cc51b24a5984
53bd414cca00f4d7172b6caba513a477195bed47 22-Apr-2018 Yigit Boyar <yboyar@google.com> Handle generic types properly in Embedded fields

Bug: 78375917
Test: PojoProcessorTest, EmbeddedTest
Change-Id: I5a47e278051b271e6be54d79ef7aa414a7679331
ndroid/arch/persistence/room/integration/testapp/dao/UserPetDao.java
ndroid/arch/persistence/room/integration/testapp/test/EmbeddedTest.java
ndroid/arch/persistence/room/integration/testapp/vo/GenericBaseClass.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndGenericPet.java
bd5b21c4f48116401194463e12b266b2dfc4a5a1 06-Apr-2018 Yuichi Araki <yaraki@google.com> resolve merge conflicts of 66af5edf83354a15415c822b11546c21bc779e5f to pi-preview1-androidx-dev

Test: I solemnly swear I tested this conflict resolution.
Change-Id: I6726038d2de9c556280f3011eb779a683c3a8331
66af5edf83354a15415c822b11546c21bc779e5f 04-Apr-2018 Yuichi Araki <yaraki@google.com> Merge "Skip VACUUM for clearAllTables in a transaction" into oc-mr1-jetpack-dev
66b879de939db087f42720c1798a69d7648801a8 02-Apr-2018 Yuichi Araki <yaraki@google.com> Skip VACUUM for clearAllTables in a transaction

Skip executing VACUUM if clearAllTables is run in a transaction.

Test: ClearAllTablesTest
Bug: 77235565
Change-Id: I25554b0442e712aba6cf2024be13b537273e071b
ndroid/arch/persistence/room/integration/testapp/test/ClearAllTablesTest.java
7c8485a42335f26210b00aa17e4077e035d034e1 03-Apr-2018 Yigit Boyar <yboyar@google.com> resolve merge conflicts of 2a49185d705b44ce82359c07a3747549a8eaaf4f to pi-preview1-androidx-dev

Test: I solemnly swear I tested this conflict resolution.
Change-Id: I5ed6de8c3b56b37ccc86b6cdfd2f1da565c32821
2a49185d705b44ce82359c07a3747549a8eaaf4f 03-Apr-2018 Yigit Boyar <yboyar@google.com> FIx RxJava Single & Maybe queries

We had a bug where the generated code for RxJava's Single and
Maybe would release the RoomSQLQuery object they use after the
first run. This would create an issue if the developer hold onto
the Single / Maybe and try to use it again. By that time, we would
re-use the query holder for another query.

Now generated code uses finalizer to release the query. It is
questionable whether it is worth doing the finalize block but
for consistency w/ other generated code, i'm keeping it.

Bug:76031240
Test: RxJava2Test
Change-Id: I6005995addfc8aa529c47e8f1d5bc653bc7f1415
ndroid/arch/persistence/room/integration/testapp/test/RxJava2Test.java
77f8712e8b5193b2c99d7591d65aeaa200af9e33 30-Mar-2018 Jake Wharton <jakew@google.com> Add private constructors to static utility classes.

Bug: 37063037
Test: ./gradlew -p app-toolkit assAnT (with PrivateConstructorForUtilityClass enabled)
Change-Id: Id0e3fb0e6ae8d727de65af88546c89197e512958
ndroidx/room/InvalidationTrackerTrojan.java
ndroidx/room/integration/testapp/test/TestUtil.java
ddee2b5170ae257a7b2494f8aaa8459ebed806dc 22-Mar-2018 Aurimas Liutikas <aurimas@google.com> Move executors to androidx.arch.core.executor.

Intially we moved them to androidx.executor but that does not quite work
as these classes are still in androidx.arch.core:core-runtime.

Bug: 74405443
Test: ./gradlew assembleDebug
Change-Id: If1216a617ed7c98e3b7c32af7e10246527a292a6
ndroidx/room/integration/testapp/paging/DataSourceFactoryTest.java
ndroidx/room/integration/testapp/test/FunnyNamedDaoTest.java
ndroidx/room/integration/testapp/test/InvalidationTest.java
ndroidx/room/integration/testapp/test/LiveDataQueryTest.java
ndroidx/room/integration/testapp/test/QueryTransactionTest.java
ndroidx/room/integration/testapp/test/RawQueryTest.java
ndroidx/room/integration/testapp/test/RxJava2Test.java
ndroidx/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java
ba069d50913c3fb250bb60ec310439db36895337 09-Mar-2018 Alan Viverette <alanv@google.com> DO NOT MERGE. Migrate app-toolkit projects to androidx

Bug: 74405443
Test: ./gradlew createArchive
Change-Id: Iae6f83cc396dbcdc5ae2a98793e9c7c61d94367e
ndroid/arch/persistence/room/InvalidationTrackerTrojan.java
ndroid/arch/persistence/room/integration/testapp/PKeyTestDatabase.java
ndroid/arch/persistence/room/integration/testapp/TestDatabase.java
ndroid/arch/persistence/room/integration/testapp/dao/BlobEntityDao.java
ndroid/arch/persistence/room/integration/testapp/dao/FunnyNamedDao.java
ndroid/arch/persistence/room/integration/testapp/dao/PetCoupleDao.java
ndroid/arch/persistence/room/integration/testapp/dao/PetDao.java
ndroid/arch/persistence/room/integration/testapp/dao/ProductDao.java
ndroid/arch/persistence/room/integration/testapp/dao/RawDao.java
ndroid/arch/persistence/room/integration/testapp/dao/SchoolDao.java
ndroid/arch/persistence/room/integration/testapp/dao/SpecificDogDao.java
ndroid/arch/persistence/room/integration/testapp/dao/ToyDao.java
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/dao/UserPetDao.java
ndroid/arch/persistence/room/integration/testapp/dao/WithClauseDao.java
ndroid/arch/persistence/room/integration/testapp/migration/MigrationDb.java
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
ndroid/arch/persistence/room/integration/testapp/paging/DataSourceFactoryTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/ClearAllTablesTest.java
ndroid/arch/persistence/room/integration/testapp/test/CollationTest.java
ndroid/arch/persistence/room/integration/testapp/test/ConstructorTest.java
ndroid/arch/persistence/room/integration/testapp/test/CustomDatabaseTest.java
ndroid/arch/persistence/room/integration/testapp/test/DaoNameConflictTest.java
ndroid/arch/persistence/room/integration/testapp/test/DatabaseCallbackTest.java
ndroid/arch/persistence/room/integration/testapp/test/EmbeddedTest.java
ndroid/arch/persistence/room/integration/testapp/test/ForeignKeyTest.java
ndroid/arch/persistence/room/integration/testapp/test/FunnyNamedDaoTest.java
ndroid/arch/persistence/room/integration/testapp/test/GenericEntityTest.java
ndroid/arch/persistence/room/integration/testapp/test/IdentityDetectionTest.java
ndroid/arch/persistence/room/integration/testapp/test/IndexingTest.java
ndroid/arch/persistence/room/integration/testapp/test/InvalidationTest.java
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
ndroid/arch/persistence/room/integration/testapp/test/MainThreadCheckTest.java
ndroid/arch/persistence/room/integration/testapp/test/PojoTest.java
ndroid/arch/persistence/room/integration/testapp/test/PojoWithRelationTest.java
ndroid/arch/persistence/room/integration/testapp/test/PrimaryKeyTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryTransactionTest.java
ndroid/arch/persistence/room/integration/testapp/test/RawQueryTest.java
ndroid/arch/persistence/room/integration/testapp/test/RelationWithReservedKeywordTest.java
ndroid/arch/persistence/room/integration/testapp/test/RxJava2Test.java
ndroid/arch/persistence/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
ndroid/arch/persistence/room/integration/testapp/test/TestDatabaseTest.java
ndroid/arch/persistence/room/integration/testapp/test/TestUtil.java
ndroid/arch/persistence/room/integration/testapp/test/WithClauseTest.java
ndroid/arch/persistence/room/integration/testapp/test/WriteAheadLoggingTest.java
ndroid/arch/persistence/room/integration/testapp/vo/Address.java
ndroid/arch/persistence/room/integration/testapp/vo/AvgWeightByAge.java
ndroid/arch/persistence/room/integration/testapp/vo/BlobEntity.java
ndroid/arch/persistence/room/integration/testapp/vo/Coordinates.java
ndroid/arch/persistence/room/integration/testapp/vo/Day.java
ndroid/arch/persistence/room/integration/testapp/vo/EmbeddedUserAndAllPets.java
ndroid/arch/persistence/room/integration/testapp/vo/FunnyNamedEntity.java
ndroid/arch/persistence/room/integration/testapp/vo/IntAutoIncPKeyEntity.java
ndroid/arch/persistence/room/integration/testapp/vo/IntegerAutoIncPKeyEntity.java
ndroid/arch/persistence/room/integration/testapp/vo/IntegerPKeyEntity.java
ndroid/arch/persistence/room/integration/testapp/vo/NameAndLastName.java
ndroid/arch/persistence/room/integration/testapp/vo/ObjectPKeyEntity.java
ndroid/arch/persistence/room/integration/testapp/vo/Pet.java
ndroid/arch/persistence/room/integration/testapp/vo/PetAndToys.java
ndroid/arch/persistence/room/integration/testapp/vo/PetCouple.java
ndroid/arch/persistence/room/integration/testapp/vo/PetWithToyIds.java
ndroid/arch/persistence/room/integration/testapp/vo/PetsToys.java
ndroid/arch/persistence/room/integration/testapp/vo/Product.java
ndroid/arch/persistence/room/integration/testapp/vo/School.java
ndroid/arch/persistence/room/integration/testapp/vo/SchoolRef.java
ndroid/arch/persistence/room/integration/testapp/vo/Toy.java
ndroid/arch/persistence/room/integration/testapp/vo/User.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndAllPets.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndPet.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndPetAdoptionDates.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndPetNonNull.java
ndroid/arch/persistence/room/integration/testapp/vo/UserIdAndPetNames.java
ndroid/arch/persistence/room/integration/testapp/vo/UserWithPetsAndToys.java
ndroidx/room/InvalidationTrackerTrojan.java
ndroidx/room/integration/testapp/PKeyTestDatabase.java
ndroidx/room/integration/testapp/TestDatabase.java
ndroidx/room/integration/testapp/dao/BlobEntityDao.java
ndroidx/room/integration/testapp/dao/FunnyNamedDao.java
ndroidx/room/integration/testapp/dao/PetCoupleDao.java
ndroidx/room/integration/testapp/dao/PetDao.java
ndroidx/room/integration/testapp/dao/ProductDao.java
ndroidx/room/integration/testapp/dao/RawDao.java
ndroidx/room/integration/testapp/dao/SchoolDao.java
ndroidx/room/integration/testapp/dao/SpecificDogDao.java
ndroidx/room/integration/testapp/dao/ToyDao.java
ndroidx/room/integration/testapp/dao/UserDao.java
ndroidx/room/integration/testapp/dao/UserPetDao.java
ndroidx/room/integration/testapp/dao/WithClauseDao.java
ndroidx/room/integration/testapp/migration/MigrationDb.java
ndroidx/room/integration/testapp/migration/MigrationTest.java
ndroidx/room/integration/testapp/paging/DataSourceFactoryTest.java
ndroidx/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroidx/room/integration/testapp/test/ClearAllTablesTest.java
ndroidx/room/integration/testapp/test/CollationTest.java
ndroidx/room/integration/testapp/test/ConstructorTest.java
ndroidx/room/integration/testapp/test/CustomDatabaseTest.java
ndroidx/room/integration/testapp/test/DaoNameConflictTest.java
ndroidx/room/integration/testapp/test/DatabaseCallbackTest.java
ndroidx/room/integration/testapp/test/EmbeddedTest.java
ndroidx/room/integration/testapp/test/ForeignKeyTest.java
ndroidx/room/integration/testapp/test/FunnyNamedDaoTest.java
ndroidx/room/integration/testapp/test/GenericEntityTest.java
ndroidx/room/integration/testapp/test/IdentityDetectionTest.java
ndroidx/room/integration/testapp/test/IndexingTest.java
ndroidx/room/integration/testapp/test/InvalidationTest.java
ndroidx/room/integration/testapp/test/LiveDataQueryTest.java
ndroidx/room/integration/testapp/test/MainThreadCheckTest.java
ndroidx/room/integration/testapp/test/PojoTest.java
ndroidx/room/integration/testapp/test/PojoWithRelationTest.java
ndroidx/room/integration/testapp/test/PrimaryKeyTest.java
ndroidx/room/integration/testapp/test/QueryTransactionTest.java
ndroidx/room/integration/testapp/test/RawQueryTest.java
ndroidx/room/integration/testapp/test/RelationWithReservedKeywordTest.java
ndroidx/room/integration/testapp/test/RxJava2Test.java
ndroidx/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java
ndroidx/room/integration/testapp/test/SimpleEntityReadWriteTest.java
ndroidx/room/integration/testapp/test/TestDatabaseTest.java
ndroidx/room/integration/testapp/test/TestUtil.java
ndroidx/room/integration/testapp/test/WithClauseTest.java
ndroidx/room/integration/testapp/test/WriteAheadLoggingTest.java
ndroidx/room/integration/testapp/vo/Address.java
ndroidx/room/integration/testapp/vo/AvgWeightByAge.java
ndroidx/room/integration/testapp/vo/BlobEntity.java
ndroidx/room/integration/testapp/vo/Coordinates.java
ndroidx/room/integration/testapp/vo/Day.java
ndroidx/room/integration/testapp/vo/EmbeddedUserAndAllPets.java
ndroidx/room/integration/testapp/vo/FunnyNamedEntity.java
ndroidx/room/integration/testapp/vo/IntAutoIncPKeyEntity.java
ndroidx/room/integration/testapp/vo/IntegerAutoIncPKeyEntity.java
ndroidx/room/integration/testapp/vo/IntegerPKeyEntity.java
ndroidx/room/integration/testapp/vo/NameAndLastName.java
ndroidx/room/integration/testapp/vo/ObjectPKeyEntity.java
ndroidx/room/integration/testapp/vo/Pet.java
ndroidx/room/integration/testapp/vo/PetAndToys.java
ndroidx/room/integration/testapp/vo/PetCouple.java
ndroidx/room/integration/testapp/vo/PetWithToyIds.java
ndroidx/room/integration/testapp/vo/PetsToys.java
ndroidx/room/integration/testapp/vo/Product.java
ndroidx/room/integration/testapp/vo/School.java
ndroidx/room/integration/testapp/vo/SchoolRef.java
ndroidx/room/integration/testapp/vo/Toy.java
ndroidx/room/integration/testapp/vo/User.java
ndroidx/room/integration/testapp/vo/UserAndAllPets.java
ndroidx/room/integration/testapp/vo/UserAndPet.java
ndroidx/room/integration/testapp/vo/UserAndPetAdoptionDates.java
ndroidx/room/integration/testapp/vo/UserAndPetNonNull.java
ndroidx/room/integration/testapp/vo/UserIdAndPetNames.java
ndroidx/room/integration/testapp/vo/UserWithPetsAndToys.java
e3d3270bc3d4fb87bb10fdf4d223ccc32ffbeae7 20-Mar-2018 Yigit Boyar <yboyar@google.com> Merge "Remove string query from @RawQuery :'(" into oc-mr1-jetpack-dev
am: a5ba9500ad

Change-Id: I3ca2edb1953c468211f3f8b047918c048fb853e5
a5ba9500add0dec1ec2b3e2841f665938fe985f2 20-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Remove string query from @RawQuery :'(" into oc-mr1-jetpack-dev
903a717d44390357b213ffd1c7f2bcf3ec3bedc4 20-Mar-2018 Yigit Boyar <yboyar@google.com> Merge "clearAllTables clears the data from file" into oc-mr1-jetpack-dev
am: a5f79fed53

Change-Id: Iacbca9f488a39b7bc1fc1ea6211a5cc25f2bb644
809a35ac827a1cd7f3394dcff7254c1423739fc8 16-Mar-2018 Yigit Boyar <yboyar@google.com> Remove string query from @RawQuery :'(

Also clarified docs to say that RawQuery is for read queries.

Bug: 74558066
Bug: 74588066
Test: existing tests pass
Change-Id: I655766dfe2c15b8e53292ae501c49295ebe72c43
ndroid/arch/persistence/room/integration/testapp/dao/RawDao.java
ndroid/arch/persistence/room/integration/testapp/test/RawQueryTest.java
7a8b4c9ce824dff0416525ec33302d228901c899 15-Mar-2018 Yuichi Araki <yaraki@google.com> clearAllTables clears the data from file

Use PRAGMA wal_checkpoint and VACUUM to make sure that
RoomDatabase#clearAllTables clears the data chunk from the database
file.

Developers still need to close the database if they need to clear the
data immediately.

Bug: 74558066
Test: ClearAllTablesTest
Change-Id: I1e932f495ea6f4460f0460ac3fa7418f578d169f
ndroid/arch/persistence/room/integration/testapp/test/ClearAllTablesTest.java
80dcc1a31d7501008cd47743b0dca190aa3c7946 14-Mar-2018 Yuichi Araki <yaraki@google.com> Merge "Do not try to create a table in identity check" into oc-mr1-jetpack-dev
am: e1d7aebf72

Change-Id: I9b56c8f1961ab2a50b0118abaddbc4264740b080
e1d7aebf72bad3123acbfebe1a5b68b772cf0b39 14-Mar-2018 Yuichi Araki <yaraki@google.com> Merge "Do not try to create a table in identity check" into oc-mr1-jetpack-dev
003725dcabf9f31e72edc68f524aac618ea95425 13-Mar-2018 Yigit Boyar <yboyar@google.com> Allow embedded and relation in raw query observed tables
am: 71d73407ef

Change-Id: Idb13951772d2379bffaad35a9f07dd759fc33651
71d73407ef17998685b29cc5c04cefb6d74e99c3 06-Mar-2018 Yigit Boyar <yboyar@google.com> Allow embedded and relation in raw query observed tables

RawQuery expects developer to list accessed tables in the
annotation. Many people got confused w/ the fact that it is
limited to the @Entity annotated classes. It becomes very
inconvenient to list all entities when you are fetching a
composite object (like an object w/ relations or embedded
fields).

This CL allows putting any java class there as long as it
has a relation or embedded field.

Bug: 74041772
Test: RawQueryProcessorTest, RawQueryTest (integration)
Change-Id: Ibf21ccb566a155a9ee9cee8075dd956c83056fe3
ndroid/arch/persistence/room/integration/testapp/dao/RawDao.java
ndroid/arch/persistence/room/integration/testapp/test/RawQueryTest.java
7ce96deb4511a8106d475e7cf8dfa13d2b05a3b6 06-Mar-2018 Yuichi Araki <yaraki@google.com> Do not try to create a table in identity check

The SQLiteDatabase object passed to the onOpen callback might be in an
intermediate state in WAL mode, and we sometimes get a read-only
connection.

Initially, we worked around it by explicitly getting a read-write
connection by wrapping write operations in a transaction, but it can
still fail from time to time.

This CL instead removes the write operation used in checking identity
hash. This does not change the surfacing behavior. If the Room master
table is dropped for some reason, the hash cannot be checked and an
exception is thrown. The only difference is that the master table can
only be recreated in onCreate or onUpgrade, not in onOpen.

Bug: 74214018
Test: IdentityDetectionTest and all existing tests
Change-Id: Ib5cc26c281915677ef819fb019b6e769b2dfda7e
ndroid/arch/persistence/room/integration/testapp/test/IdentityDetectionTest.java
6a08c3343437e966f9437e46412dd6f8774cd9fe 06-Mar-2018 Chris Craik <ccraik@google.com> Merge "Query accessedTableNames for DataSource.Factory, join them correctly" into oc-mr1-jetpack-dev
am: e118c4150a

Change-Id: Ie608c07b968e6bb44f8573767401886c9a648375
1b805d37217a328107a7ad021c877d3c224e5869 03-Mar-2018 Chris Craik <ccraik@google.com> Query accessedTableNames for DataSource.Factory, join them correctly

Fixes: 67993046
Fixes: 74128314
Test: QueryMethodProcessorTest, DataSourceFactoryTest
Change-Id: I63f745c5833fa3ca7728e8c71bcca1a4977b6a1d
ndroid/arch/persistence/room/integration/testapp/dao/UserPetDao.java
ndroid/arch/persistence/room/integration/testapp/paging/DataSourceFactoryTest.java
7eea7a06981f361dadbc5eec8ac6368e9fde2975 01-Mar-2018 Yigit Boyar <yboyar@google.com> resolve merge conflicts of db5bf4565f3f37f4ff73d65009c2bd23faf48a82 to pi-preview1-androidx-dev

Test: I solemnly swear I tested this conflict resolution.
Change-Id: I5deee5b77bad47cd29c3092457358b93c746e126
533bde46114bae04323d2a7c29fdba3829713a20 28-Feb-2018 Yigit Boyar <yboyar@google.com> Move query parameter into local final

This CL fixes a bug where we would try to access query parameters
inside callbacks even though they are not marked as final.

This ensures that the rest of the code can keep assuming that the
query variables are final.

Bug: 73981394
Test: RawDooTest
Change-Id: I0330de55537039bc21150092e7e94383977ab472
ndroid/arch/persistence/room/integration/testapp/dao/RawDao.java
ndroid/arch/persistence/room/integration/testapp/test/RawQueryTest.java
fd1a1d431fb2c5fba29e26e5466ddffa3a5ff27c 28-Feb-2018 Yuichi Araki <yaraki@google.com> Merge "LOCALIZED and UNICODE collations need API Level 21" into oc-mr1-jetpack-dev
am: 218e20c75a

Change-Id: I79f015ca8869c74491b846cf02119051437bdd65
6e04031d0ff25453c242e7f6e2851cb3b79b7a9b 28-Feb-2018 Yuichi Araki <yaraki@google.com> Merge "Remove java.util.Objects from the testapp" into oc-mr1-jetpack-dev
am: 2aa7c697a6

Change-Id: I563b91e920936f6138928ee95934ce0be590762e
218e20c75a0c0da0bde7725cb7f3b7298a976abb 28-Feb-2018 Yuichi Araki <yaraki@google.com> Merge "LOCALIZED and UNICODE collations need API Level 21" into oc-mr1-jetpack-dev
196e69bfcea3d22a76ea20ebd3413c6ab94c42d7 27-Feb-2018 Yuichi Araki <yaraki@google.com> Merge "Synchronous observers in InvalidationTracker" into oc-mr1-jetpack-dev
am: f102b0ed2c

Change-Id: I4ddc9b07550b785ad01107f08e442cfa9a1386d6
6283105481610c4b5d5bb8b826ab316d1d24e1d3 27-Feb-2018 Yigit Boyar <yboyar@google.com> Merge "Escape fields when generating relation queries" into oc-mr1-jetpack-dev
am: 18ae4dabb0

Change-Id: Ic873d8de7cc514e30f4cef440fece7c33c2bb85d
0e01df38822f4043b5b6ef7b1c3d8de0767c16f0 27-Feb-2018 Yuichi Araki <yaraki@google.com> LOCALIZED and UNICODE collations need API Level 21

Test: CollationTest
Change-Id: Id358d3344a1123798ab17e69bc0cdadf3cabb98e
ndroid/arch/persistence/room/integration/testapp/test/CollationTest.java
359e3f1cf1dbc468b1bbdf58c6b74e7a5b6abb70 27-Feb-2018 Yuichi Araki <yaraki@google.com> Remove java.util.Objects from the testapp

java.util.Objects is available only on API Level 19 and above.

Test: This is a test fix
Change-Id: I78231fa4e0edaa7893ad27b39d86a0273351c5f9
ndroid/arch/persistence/room/integration/testapp/test/DaoNameConflictTest.java
ndroid/arch/persistence/room/integration/testapp/test/GenericEntityTest.java
ndroid/arch/persistence/room/integration/testapp/test/RelationWithReservedKeywordTest.java
f102b0ed2c101f9e635a54bcbea76cebecfd3f18 27-Feb-2018 Yuichi Araki <yaraki@google.com> Merge "Synchronous observers in InvalidationTracker" into oc-mr1-jetpack-dev
18ae4dabb08c2006d19cb3c48e34ad4deedd716a 27-Feb-2018 Yigit Boyar <yboyar@google.com> Merge "Escape fields when generating relation queries" into oc-mr1-jetpack-dev
e387b7c84d11ecab6ab9bbf66cf7df8bab192848 26-Feb-2018 Yigit Boyar <yboyar@google.com> Merge "Support RawQuery in paging data source" into oc-mr1-jetpack-dev
eb18576ec242ec4169564064c0ff6bf427c23fe1 26-Feb-2018 Yigit Boyar <yboyar@google.com> Merge changes from topic "am-e096a0ca-b1ac-4765-aef7-f3b506db9275"

* changes:
[automerger] Support RawQuery in paging data source am: cab865bed3
Support RawQuery in paging data source
1e6eadb9fb537c6bd81cc6a50ab685711cd84fd9 22-Feb-2018 Sergey Vasilinets <sergeyv@google.com> Assert main thread in observe and observeForever in LiveData

bug: 72211837
Test: ./gradlew :lifecycle:livedata-core:test
Change-Id: I47d1b4ed19bd61c097bc2bde031af3206bfe8191
ndroid/arch/persistence/room/integration/testapp/test/FunnyNamedDaoTest.java
ndroid/arch/persistence/room/integration/testapp/test/RawQueryTest.java
81642c82eef72885cbdf5b66b95f905d2c6250be 26-Feb-2018 Yigit Boyar <yboyar@google.com> Escape fields when generating relation queries

Bug: 70925483
Test: RelationWithReservedKeywordTest
Change-Id: I2487aa738a7fe3e41ab986982bb2e019327e83f7
ndroid/arch/persistence/room/integration/testapp/test/RelationWithReservedKeywordTest.java
458885cbb4677ae06ce3bd0c4172c86928a7b101 20-Feb-2018 Yuichi Araki <yaraki@google.com> Synchronous observers in InvalidationTracker

InvalidationTracker now synchronously creates TEMP TRIGGERS when
addObserver is called.

Bug: 73592149
Test: WriteAheadLoggingTest
Change-Id: I03f3c05fca0a1d38a9b8397eda3e943a93c386fa
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/WriteAheadLoggingTest.java
46237f26d1d2363c55df23023642e9081d276d58 23-Feb-2018 Yuichi Araki <yaraki@google.com> Merge "Clear all the tables in the database" into oc-mr1-jetpack-dev
cf761e57353d325dfdd4fa242347ecfe39e66b3f 23-Feb-2018 Yuichi Araki <yaraki@google.com> Merge changes from topic "am-c174fa90-3b80-44b3-b9a1-fcf4b9c1a74d"

* changes:
[automerger] Clear all the tables in the database am: fe072103d8
Clear all the tables in the database
cab865bed3b4e9df8b86b0b16c589c4e6dd0b71d 21-Feb-2018 Yigit Boyar <yboyar@google.com> Support RawQuery in paging data source

This CL fixes a bug where paged list data source would not generate
proper code when a RawQuery is provided.

To overcome this, I've created a RoomSQLiteQuery helper method that
creates a query from a given support query.

I've also added getArgCount to the SupportSQLiteQuery API, which was
previously requested (b/67038952).

Bug: 67038952
Bug: 72600425
Test: DataSourceFactoryTest
Change-Id: I76183d6f02e9809bdbdad2d24159900497828b1b
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/DataSourceFactoryTest.java
025c82a50fb1ea3201652922d1a0f05532765524 21-Feb-2018 Yigit Boyar <yboyar@google.com> Merge "Prefix dao names w/ containing class" into oc-mr1-jetpack-dev
fe072103d888dcd93ed30302b9e50e4211458057 14-Feb-2018 Yuichi Araki <yaraki@google.com> Clear all the tables in the database

This adds RoomDatabase.clearAllTables that deletes all the rows in the
database.

Bug: 63807999
Test: ClearAllTablesTest
Change-Id: I020b7b59d55ba16f20b204fec07c9ee840c0b57d
ndroid/arch/persistence/room/integration/testapp/test/ClearAllTablesTest.java
0520dcbbc0ba4cbbc74443cbe631a21f39e14545 20-Feb-2018 Android Build Merger (Role) <noreply-android-build-merger@google.com> [automerger] Prefix dao names w/ containing class am: 06baf18160

Change-Id: Ib2976656f36a64a9df3340869cbf21fc930bbca7
06baf181601292a02278faf8e628efd2a9f20e4a 20-Feb-2018 Yigit Boyar <yboyar@google.com> Prefix dao names w/ containing class

This CL fixes a bug where we would not take the containing classes
into account when deciding the DAO's implementation name, which
would cause a problem if 2 classes in the same package has the
same inner DAO class name.

Bug: 73536380
Test: DaoNameConflictTest
Change-Id: I7b100b7f2b307b865697abd7cc9d53c4090ad4f4
ndroid/arch/persistence/room/integration/testapp/test/DaoNameConflictTest.java
757abd3002dff7725cde3cebdbf9bfeed691d2f9 20-Feb-2018 Yigit Boyar <yboyar@google.com> Properly parse pojo methods as member of the owner

This CL fixes a bug where we were not converting processed methods
to members of the owner pojo. This results in a problem where we
would not resolve method type parameters properly.

Bug: 73534868
Test: GenericEntityTest
Change-Id: Ic75a08d53ca0705765c079c6571b65a05fad2525
ndroid/arch/persistence/room/integration/testapp/test/GenericEntityTest.java
2eb8c31eb44ee4bc4138136b8866847b6e49e5b2 30-Jan-2018 Yuichi Araki <yaraki@google.com> Support for Write-Ahead Logging

This adds RoomDatabase.Builder.setJournalMode for specifying the journal
mode for the SQLite database. Room now uses WAL as the default journal
mode.

In WAL, InvalidationTracker uses a transaction for monitoring the
updated tables.

Bug: 67757002
Test: WriteAheadLoggingTest
Change-Id: I42be8680616266fd42b471a7c561c22e70d0b3dc
ndroid/arch/persistence/room/integration/testapp/test/WriteAheadLoggingTest.java
a1094b313baec4bfc36554b644c362fa5708fdc6 10-Feb-2018 Yigit Boyar <yboyar@google.com> Enable error prone for integration tests

The CL adds a new field enableErrorProne to the SupportAndroidTestAppExtension.
Unlike the library counterpart, setting this on changes the default toolchain to
use error prone. This OK since we don't ship the code for integraiton tests.

I've also enabled the flag for Room's integration tests. This will help us ensure
that Room generates OK code that won't cause problems when developer runs
error prone on their own code.

Bug: 72758431
Test: existing apps compile fine
Change-Id: Ie1542bf2bffc1da3b024e279c12d611d14f479e3
ndroid/arch/persistence/room/integration/testapp/test/QueryTransactionTest.java
ffa35f34d8628ca8c8ee1427da8bdaef91e9d2f5 24-Jan-2018 Yuichi Araki <yaraki@google.com> Fix DatabaseCallbackTest.createAndOpen
am: 17924f721e

Change-Id: Iae904b3e256689b072c04fe14ea010455c866d84
17924f721ea5301dde88b59aaae7e9e63362e7fe 24-Jan-2018 Yuichi Araki <yaraki@google.com> Fix DatabaseCallbackTest.createAndOpen

The test was failing when the test app was re-run without being
uninstalled.

Test: This fixes the test
Change-Id: I90469a0451798f73ba579b8ca78a63aefdd4d9be
ndroid/arch/persistence/room/integration/testapp/test/DatabaseCallbackTest.java
cef4d9117efec4248e5cbb921e69bf1b86ba5c35 24-Jan-2018 Yuichi Araki <yaraki@google.com> Use @Transaction with default interface methods
am: 3b909e309e

Change-Id: Icb2cc8d52f00b59bfb351586ceca82849d08fc96
3b909e309e35eef52ae8d6de906f956a771deb31 23-Jan-2018 Yuichi Araki <yaraki@google.com> Use @Transaction with default interface methods

Allow use of @Transaction on methods with default implementation in Java
interfaces.

This CL does not cover Kotlin interfaces as its default implementation
works in a completely different way.

Test: SimpleEntityReadWriteTest, DaoProcessorTest
Change-Id: Id346050d784ec1b44363610f81869a27f343e196
ndroid/arch/persistence/room/integration/testapp/dao/PetDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
3cb8128992118628c70c5b5949a2e4da1d133bab 18-Jan-2018 Yigit Boyar <yboyar@google.com> Int columns cannot be converted to boolean directly
am: 948fe95268

Change-Id: If6c331e01d8242b4091aed09c4cbcf4dba099ee9
948fe952685b4c7386895cb595214a885e579014 11-Jan-2018 Yigit Boyar <yboyar@google.com> Int columns cannot be converted to boolean directly

Previously, Boolean was considered as a possible output for
INT affinity columns but this is wrong since we do need a
converter for that to work (PrimitiveBooleanToIntConverter).

Bug: 71855433
Test: LiveDataQueryTest, SimpleEntityReadWriteTest
Change-Id: I08270616783e14f85f5e0f9c0388cb703c18cda4
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
9822109708fc59caace699c56eb5414c635d7fb9 11-Jan-2018 Chris Craik <ccraik@google.com> Merge "Switch room to latest paging APIs" into oc-mr1-support-27.0-dev
am: 413b6bde0e

Change-Id: I4b6c3892a99cccafd58fb514b669cad1e53de775
413b6bde0ebef3eb387a9f798492ad423aef87fd 11-Jan-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Switch room to latest paging APIs" into oc-mr1-support-27.0-dev
dc60cacc66972b47f27acdf727332878ce5958ae 10-Jan-2018 Chris Craik <ccraik@google.com> Switch room to latest paging APIs

Test: tests in room-compiler, room-integrations-tests-testapp

Removes all references to deprecated LivePagedListProvider and TiledDataSource.

Change-Id: Ie49bf75df0b59cfd9d808be95dfd990f76ebe664
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/DataSourceFactoryTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryTransactionTest.java
b2ee0cc703149170cdf9fefc0cadd7f95bf28843 08-Jan-2018 Shep Shapard <shepshapard@google.com> Merge "Implements fallbackToDestructiveMigrationFrom(int ...) for more fine-grained control over destructive migrations." into oc-mr1-support-27.0-dev
am: 0147f98e9d

Change-Id: I6bfa85734d1ad59f0f28ad0f7a4f733f4b7a2d55
0147f98e9d0663a10b570dda849f55492dea9d7c 08-Jan-2018 Shep Shapard <shepshapard@google.com> Merge "Implements fallbackToDestructiveMigrationFrom(int ...) for more fine-grained control over destructive migrations." into oc-mr1-support-27.0-dev
74400bffe60396edf353e0a919c0e3784e9f7a67 06-Jan-2018 Yigit Boyar <yboyar@google.com> RawQuery support
am: de23b91b2c

Change-Id: Iff372bc62d999d0d9b2e4dad2e77d87108868ce5
d2658c69a5eb56c5fa7f09bd361974aa2452b320 10-Nov-2017 shepshapard <shepshapard@google.com> Implements fallbackToDestructiveMigrationFrom(int ...) for more fine-grained control over destructive migrations.

Bug: 64989640
Test: MigrationTest#fallbackToDestructiveMigrationFrom_fromStart_destructive
MigrationTest#fallbackToDestructiveMigrationFrom_fromStart_withTrailingMigration_destructive
MigrationTest#fallbackToDestructiveMigrationFrom_suppliedValueIsMigrationStartVersion_exception
MigrationTest#fallbackToDestructiveMigrationFrom_suppliedValueIsMigrationEndVersion_exception
BuilderTest#fallbackToDestructiveMigrationFrom_calledOnce_migrationsNotRequiredForValues
BuilderTest#fallbackToDestructiveMigrationFrom_calledTwice_migrationsNotRequiredForValues
BuilderTest#isMigrationRequiredFrom_fallBackToDestructiveCalled_alwaysReturnsFalse
BuilderTest#isMigrationRequiredFrom_byDefault_alwaysReturnsTrue
BuilderTest#isMigrationRequiredFrom_fallBackToDestFromCalled_falseForProvidedValues
BuilderTest#isMigrationRequiredFrom_fallBackToDestFromCalled_trueForNonProvidedValues

Change-Id: I968beca545645261ffa0020c5d7d201ce089a3e9
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
de23b91b2c982ef5c93349b16415654ae3fe5ac9 04-Jan-2018 Yigit Boyar <yboyar@google.com> RawQuery support

This CL adds a new annotation where DAO methods can have a method
annotated with @RawQuery which should receive 1 and only 1 parameter
of type String or SupportSQLiteQuery.

Bug: 71458963
Bug: 62103290
Test: RawDaoTest, RawQueryMethodProcessorTest
Change-Id: I948e79d93258f69d7c11dbb54f2943d6e51879b3
ndroid/arch/persistence/room/integration/testapp/TestDatabase.java
ndroid/arch/persistence/room/integration/testapp/dao/RawDao.java
ndroid/arch/persistence/room/integration/testapp/test/RawQueryTest.java
ndroid/arch/persistence/room/integration/testapp/test/TestDatabaseTest.java
ndroid/arch/persistence/room/integration/testapp/vo/NameAndLastName.java
b2200b494e1143d37375b555a279e35a26a22441 05-Jan-2018 Yigit Boyar <yboyar@google.com> Merge "Allow LOCALIZED and UNICODE collations" into oc-mr1-support-27.0-dev
am: 4cfbb695ea

Change-Id: I54badeb9947578815f352ed430f86e1f8451c08a
4cfbb695ea3a5bc5b22e992ea4ae00ac8c1ae959 05-Jan-2018 Yigit Boyar <yboyar@google.com> Merge "Allow LOCALIZED and UNICODE collations" into oc-mr1-support-27.0-dev
4f8529aaec79274efc06b1b570226bec361c56a3 05-Jan-2018 Aurimas Liutikas <aurimas@google.com> Merge "Add missing @RestrictTo and test size annotations." into oc-mr1-jetpack-dev
04c9e28ea0be0cedcee58e4d29343ac08733d58a 04-Jan-2018 Aurimas Liutikas <aurimas@google.com> Add missing @RestrictTo and test size annotations.

Ran checkstyle over all of support lib java code to find missing @RestrictTo
and test size annotations.

../../prebuilts/checkstyle/checkstyle.py -c development/checkstyle/config/support-lib.xml \
-p development/checkstyle/prebuilt/com.android.support.checkstyle.jar -f *

Test: ./gradlew assembleDebug
Change-Id: Iaa3303999785c5cbf26c02338c4a3935df969ca2
ndroid/arch/persistence/room/integration/testapp/test/PojoTest.java
05be099ca51c94e99b23b063b88e8f9d4490f8fb 05-Jan-2018 Yigit Boyar <yboyar@google.com> Allow LOCALIZED and UNICODE collations

Android has these by default.
https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html

Bug: 68925249
Test: CollationTest
Change-Id: I6fb3c3c18a429c12319821e772cd900a73c31f80
ndroid/arch/persistence/room/integration/testapp/test/CollationTest.java
8a1170e49b9f351d325b003799f173fdec2fb021 04-Jan-2018 Yigit Boyar <yboyar@google.com> Merge "Fix schema identity has to be stable" into oc-mr1-support-27.0-dev
am: 5abdc3db05

Change-Id: Ib100bb568ac7e270dfa58e6c2446de63a4eee5d4
5abdc3db051dcebce198d3967e59ad01f5019465 04-Jan-2018 Yigit Boyar <yboyar@google.com> Merge "Fix schema identity has to be stable" into oc-mr1-support-27.0-dev
c94d2567fe970370c3021987739dc8866aefedf8 04-Jan-2018 Aurimas Liutikas <aurimas@google.com> Merge "Remove use of android.test.MoreAsserts that has been removed." into oc-mr1-support-27.0-dev
am: c491fe9061

Change-Id: I2973cc341f0fa802c3e2b10571cd52115206936d
24b2115483e857d3aec386f559b76dd21aa27841 03-Jan-2018 Aurimas Liutikas <aurimas@google.com> Remove use of android.test.MoreAsserts that has been removed.

android.test.MoreAsserts has been removed from the SDK and we
can no longer use it.

Test: ran updated test in studio
Change-Id: I9144feff33e04567854fd9d3a85a535caa002242
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
64ba5eb986f00baa523673acb57abca8da69af88 02-Jan-2018 Yigit Boyar <yboyar@google.com> Merge "handle large key sets in relationships" into oc-mr1-support-27.0-dev
am: 7d4f551eda

Change-Id: I986a0cda962d2a42626b122888331217d7370ceb
e5ed537fe6f14f0bbb43ddef605ed22f09714142 19-Dec-2017 Yigit Boyar <yboyar@google.com> Fix schema identity has to be stable

Room v1 has a bug where it generates the schema identity from the
create table query, which was OK when it was written (because Room
considered column order as part of schema) but not anymore (since
we don't enforce column order).

The problem is fixed by creating both legacy and new identity hash
so that RoomOpenHelper can validate old database.

Unfortunately, this is a large CL because we don't want to update
schema json files so all of the Schema data classes implements a
new schema equality api which checks if the schema description of
two entities are the same, even though their SQL might be different.
(e.g. the column order in an entity or the auto generated index name)

Since we are not overriding json files, the fix will only take effect
after a migration.

Bug: 64290754
Test: android.arch.persistence.room.migration.bundle.*
Change-Id: I44959a353ac919850e2606ca704008ea57da7313
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
fa39e2bca1b284ad7c931d9194287770b7b507fa 21-Dec-2017 Aurimas Liutikas <aurimas@google.com> Remove uses of junit.framework.*

These classes are getting removed from android sdk

Bug: 70905568
Test: ./gradlew assembleAndroidTest
Change-Id: I60bf4c88382147cd70cbf1aa02f78abfb2ee8eca
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
6bbf7089c9d4050b04ad48e1a1e5e2c713c48840 20-Dec-2017 Yigit Boyar <yboyar@google.com> handle large key sets in relationships

If a relationship result has 1000 >= items, sqlite rejects the query.
We cannot blame the developer because query is generated by room so
we rather divide it into sub maps when this happens.

It is not the most efficient way to divide the map but since this is
unlikely to happen, seems fair.

Bug: 64643894
Test: PojoWithRelationTest#largeRelation_*
Change-Id: Ie0f2f4520e1e26681dfb3ed7239fe3c6f5e31586
ndroid/arch/persistence/room/integration/testapp/test/PojoWithRelationTest.java
3ea1d11500fdfe07866c1d6fcc970159d0f04f3a 18-Dec-2017 Yigit Boyar <yboyar@google.com> Allow single column results in relations

This CL fixes a bug where we were enforcing @Relation's return type
to adhere to the Pojo requirements which breaks if you want to use
a boxed primitive or a type with type converter.

This CL changes relationship processor to not enforce a pojo as long as
we can infer the projection from available information (e.g. user spcified).

If we need to infer projection list, we now first check if there is
a column adapter for the given type and if so, assume it is a 1 column
result and generate query accordingly.

Fixes: 68077506
Test: BooksDaoTest, PojoProcessorTest, PojoWithRelationTest
Change-Id: I34484c11248ba9be0341f498b55ecbf848f8a35b
ndroid/arch/persistence/room/integration/testapp/dao/PetDao.java
ndroid/arch/persistence/room/integration/testapp/dao/UserPetDao.java
ndroid/arch/persistence/room/integration/testapp/test/PojoWithRelationTest.java
ndroid/arch/persistence/room/integration/testapp/test/TestUtil.java
ndroid/arch/persistence/room/integration/testapp/vo/Pet.java
ndroid/arch/persistence/room/integration/testapp/vo/PetWithToyIds.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndPetAdoptionDates.java
2fb00f11f2e6d90edf678daaa921a3ef1b55a51b 15-Dec-2017 Yigit Boyar <yboyar@google.com> Allow collection type converters in query parameters

If a query parameter is a collection AND we cannot find a converter for the type parameter of it,
we will look for a converter that converts the whole thing.

Collection Type converters were broken in kotlin data classes because
kotlin creates constructor args with variance which cannot be assigned
to the fields. This CL flexes the constructor and setter check to allow
variances.

Fixes: 69164099
Test: SimpleEntityReadWriteTest, CustomTypeConverterResolutionTest, BookDaoTest,
TypeAssignmentTest

Change-Id: I48d44bb90c69ad0d9ca4aeb19f22821d89264405
ndroid/arch/persistence/room/integration/testapp/TestDatabase.java
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
ndroid/arch/persistence/room/integration/testapp/vo/Day.java
ndroid/arch/persistence/room/integration/testapp/vo/User.java
2d5d14ee842a8f60cfc44135701675acf384c619 15-Dec-2017 Yigit Boyar <yboyar@google.com> Add test for table prefixes

Bug: 64539805
Test: SqlParserTest, SimpleEntityReadWriteTest
Change-Id: I1892243c55cd4469ce3b1c3ebf39d5d03c65bfe6
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
ndroid/arch/persistence/room/integration/testapp/vo/NameAndLastName.java
7ebe40c91d058f1f3f2cddf0bc3e4a489c346fd5 14-Dec-2017 Yigit Boyar <yboyar@google.com> Add tests where constructor params have annotations

This CL adds 2 tests which have annotations in constructor parameters.
I could not reproduce the error reported in the sample but will keep
the tests.

Bug: 69562125
Test: ConstructorTest, PojoProcessorTest
Change-Id: I0cd97b57fea8be758ab85b83e6dfa415231d970b
ndroid/arch/persistence/room/integration/testapp/test/ConstructorTest.java
5dc2fd49c2887578d8b76a9014e1b43d088c7fda 30-Oct-2017 Chris Craik <ccraik@google.com> Switch DataSources to be async to better support network usecase

Test: tests in paging-common, paging-runtime, room-integration-tests-testapp

Bug: 65891711
Bug: 68724662
Bug: 68777934
Fixes: 66388173

Change-Id: I70f2f717f38984cd6b662fffabec9fd7fc684df0
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/DataSourceFactoryTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryTransactionTest.java
771816bab34735dd8fb47a93085f6b86c132154c 26-Oct-2017 Chris Craik <ccraik@google.com> Clean up ContiguousDataSource innards

Simplify ContiguousDataSource by removing unnecessary layering, and
removing the last usages of NullPaddedList. Now all of its APIs use
PageResults cleanly.

As part of this cleanup, hid internal APIs being used by
QueryDataSourceTest and ComplexQueryDataSourceTest. Those tests were
removed, since they're not proper integration tests - they're just
poking at the innards of Paging to verify a proof of concept.

Test: tests in paging-common, paging-runtime, room-integration-tests-testapp

Change-Id: Ibf82afde2be100615fcff500144bd5ec210832cf
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/ComplexQueryDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
67077406223e49eba5ecd0def10ca80dd6909f16 25-Oct-2017 Chris Craik <ccraik@google.com> Add PagedList.BoundaryCallback for network use case

PagedList.BoundaryCallback
- allows network code to listen for loading-relevant events, like the user has
scrolled near the beginning or end of PagedList data.
- allows network-only usecase to be built on top of Memory-based PagedList DataSource

Deprecates LivePagedListProvider in favor of new LivePagedListBuilder and DataSource.Factory:
- Splits concerns of DataSource construction (and providing access to data) from
creating LiveData<PagedList>
- Allows for growth of construction parameters (including new PagedList.BoundaryCallback)
- Simplifies role of library (like Room) providing data - just implement DataSource.Factory

Bug: 68316389
Test: tests in paging-common, paging-runtime, room-integration-tests-testapp

Change-Id: Idb90d8462b286bbd794c61aa7b148cd813715cfb
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/DataSourceFactoryTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LivePagedListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryTransactionTest.java
b376ec7f518d1bd82634315ded03cca0aed3ef48 17-Oct-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "PagedList storage and data access refactor" into oc-mr1-support-27.0-dev
e1178edf8a3082ca7dde8477bb43d001f67db11a 30-Sep-2017 Chris Craik <ccraik@google.com> PagedList storage and data access refactor

- Simplifies PagedList class hierarchy
- unifies PL storage into Page/PagedStorage structures
- TiledPagedList loads all initial pages at once
- TiledPagedList respects Config.initialSizeHint (with rounding, min 2 pages)
- TiledPagedList skips read query if count is 0

support for upcoming work:
- DataSources async API redesign
- support keys stored in pages
- PagedList#getConfig

Bug: 64809611
Bug: 65983562
Bug: 65891711
Test: Tests in paging-common, paging-runtime, room-integration-tests-testapp.

Change-Id: I49f78b30460c51d8aa01e5dbbba8bbb5859513b3
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryTransactionTest.java
d2cdfecb16af89f7b6a92d95f8854b261d2c6c0c 17-Oct-2017 Yigit Boyar <yboyar@google.com> Fix flaky invalidation test

This CL fixes a flakiness in invalidation test where the observer might
not be added before the insertion.

I've also changed it to use the testing library so that we can drain
tasks instead of waiting for observers which significantly speeds up
the test.

Bug: 67836388
Test: InvalidationTest
Change-Id: Icb740a7db1f8114b49393d4ad78d1d071b5902c9
ndroid/arch/persistence/room/integration/testapp/test/InvalidationTest.java
25b465c796ebee5bd7d304becbcf6a42fed53056 05-Oct-2017 Yigit Boyar <yboyar@google.com> Support @Transaction in @Query methods.

This CL adds support for using @Transaction in @Query methods.

There are 2 major use cases:
a) query result is big so may not fit in 1 cursor window.
b) query has @Relation fields which are queried separately so
may become inconsistent. For this case, we are printing a warning
to educate the developer and letting them choose if they want to
do it.

Bug: 66011356
Bug: 65112315
Test: QueryTransactionTest, DaoProcessorTest, QueryMethodProcessorTest

Change-Id: I128ce7504f8d042bf427d8eb3257654ce4dda1ff
ndroid/arch/persistence/room/integration/testapp/test/QueryTransactionTest.java
3636a95826a95f5fa47dcaed375bcb218749deb6 06-Oct-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Disable WITH Query tests before API 21" into oc-mr1-support-27.0-dev
2db0875dfb15f3d909e7721bd97e3544d0fe9ae1 04-Oct-2017 Yigit Boyar <yboyar@google.com> Validate indices in migrations

This CL improves the database migration to include index validation.

Even though we can extract more information about the index like the
order, since Room APIs do not allow it, we do not verify them.

The pragma was added in 2015 so if we cannot read index value,
we skip index validation.

Bug: 63132683
Test: MigrationTest, TableInfoTest
Change-Id: I01f35be08232f6a6bb22766553e48f7b177a21e4
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
7c6b862542d4850d992813459e2be27f353b2b81 05-Oct-2017 Yigit Boyar <yboyar@google.com> Disable WITH Query tests before API 21

Bug: 36069458
Test: tests are passing on API 16 now
Change-Id: I031ac672ba47a364d1e98901a3b50d8426e6a0cd
ndroid/arch/persistence/room/integration/testapp/dao/WithClauseDao.java
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
ndroid/arch/persistence/room/integration/testapp/test/WithClauseTest.java
8750512e139f11bcd1ee505bc117ef69769f5085 03-Oct-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow Integer and Long PrimaryKey without @NonNull annotation, for single PrimaryKeys since SQLite generates them, when null." into oc-mr1-support-27.0-dev
a1be0035ff9cb46339f02db942c990e44eab7075 29-Sep-2017 Florina Muntenescu <florinam@google.com> Allow Integer and Long PrimaryKey without @NonNull annotation, for single PrimaryKeys
since SQLite generates them, when null.

Bug: 67086876
Test: EntityProcessorTest, PrimaryKeyTest
Change-Id: I0b0aa954d7df7bb5e816dfb55214143e06ef4c9e
ndroid/arch/persistence/room/integration/testapp/PKeyTestDatabase.java
ndroid/arch/persistence/room/integration/testapp/test/PrimaryKeyTest.java
ndroid/arch/persistence/room/integration/testapp/vo/IntegerPKeyEntity.java
afbbe0af09599e93010b776bf91f54e82f23e7a3 30-Sep-2017 Yigit Boyar <yboyar@google.com> Fail when non-null fields are missing in query

This CL change Room query verification to fail IF one of
the missing columns is annotated with @NonNull. It is
probably un-intended by the developer so it is better
to fail instead of a warning.

Bug: 67115337
Test: QueryMethodProcessorTest#pojo_missingNonNull
Change-Id: I22bd5797eb5fbc22d0dd242683cbbdf0c60457db
ndroid/arch/persistence/room/integration/testapp/dao/SchoolDao.java
a9fb9a00b5d207a54759e1a21076ef3e0e04a878 01-Oct-2017 Yigit Boyar <yboyar@google.com> Merge "Handle re-entry in invalidation tracker" into oc-mr1-support-27.0-dev
ae36c8b11a64d3cdc9ba6e37d9f3d1d250fdc4a8 29-Sep-2017 Yigit Boyar <yboyar@google.com> Rename AppToolkitExecutor to ArchTaskExecutor

This CL renames AppToolkitExecutor to ArchTaskExecutor so that if someone sees that
class in a stack trace etc, it is more clear where that class is coming from.

Bug: 38200634
Test: existing tests pass
Change-Id: I252d332c5a7b4602c2a5ab874ec3c235a25bcb6d
ndroid/arch/persistence/room/integration/testapp/paging/LivePagedListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/test/InvalidationTest.java
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
ndroid/arch/persistence/room/integration/testapp/test/RxJava2Test.java
f3b01d87d24552e0d716aa6b002fcd54e2522adf 29-Sep-2017 Yigit Boyar <yboyar@google.com> Limit characters in table/column names

SQL is very free on column/table names as long as you put them
inside quotes. This is weird, hardly ever useful and makes code-gen harder.

Instead, we will just limit the set.

This CL also fixes a bug in invalidation tracker where we would
not properly observe tables if it has a space in the name.

Bug: 64749111
Test: SqliteParserTest, EntityProcessorTest, FunnyNamedDaoTest
Change-Id: I6322ee6b3b2c7c74dadc2731032969e52cfbbd98
ndroid/arch/persistence/room/integration/testapp/TestDatabase.java
ndroid/arch/persistence/room/integration/testapp/dao/FunnyNamedDao.java
ndroid/arch/persistence/room/integration/testapp/test/FunnyNamedDaoTest.java
ndroid/arch/persistence/room/integration/testapp/test/TestDatabaseTest.java
ndroid/arch/persistence/room/integration/testapp/vo/FunnyNamedEntity.java
9610cdd0c0def94a85f4b537d05e4b3226cec3b0 29-Sep-2017 Yigit Boyar <yboyar@google.com> Handle re-entry in invalidation tracker

When an instant task executor is used, InvalidationTracker would
skip refresh if it is inside transaction but leave the pending
refresh flag on, which would mean the next endTransaction would
not do anything.

This CL fixes that issue by not triggering the invalidation
tracker if current thread is still in a transaction.

It also changes InvalidationTracker to handle re-entry properly.

Bug: 65471397
Test: RxJava2WithInstantTaskExecutorTest
Change-Id: I97d1d5282080593afa97477a1e9b91f91535c04e
ndroid/arch/persistence/room/integration/testapp/test/RxJava2Test.java
ndroid/arch/persistence/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java
8df194b42f73f85f29760e8abe11d879ec49b286 28-Sep-2017 Yigit Boyar <yboyar@google.com> Handle relations in flowable invalidation

This CL fixes a bug where Flowables would ignore their relations
for invalidation checking. It works fine for LiveData but
unfortunately they had different code paths for resolving tables.

This CL merges the two into a base class that can be re-used by
any observable query provider.

Bug: 65219002
Test: RxJava2Test#flowableWithRelation
Change-Id: I3e8d7f35cae0aa8621923b39e108070aeb6c9277
ndroid/arch/persistence/room/integration/testapp/dao/UserPetDao.java
ndroid/arch/persistence/room/integration/testapp/test/RxJava2Test.java
97253f70d5f0bb5d79736629a18718526d67efa5 21-Sep-2017 Yigit Boyar <yboyar@google.com> Merge "Add @Transaction annotation" into oc-mr1-dev
2f4954c4f10e675761a365a26c90a604ffbe3d6e 20-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Enforcing a NON NULL constraint on the PrimaryKey" into oc-mr1-dev
b3c4d9308e4fd66beca3a7824a5db749ce2aace1 14-Jun-2017 Yuichi Araki <yaraki@google.com> Add @Transaction annotation

@Transaction can be put on methods in abstract Dao classes to make it
run in a transaction.

A non-abstract method is overridden in the derived Dao class and wrapped
in a transaction.

Test: SimpleEntityReadWriteTest, DaoWriterTest
Bug: 66011356
Change-Id: I40ba2c312aa5609ecee950784498a1d811ff5722
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
2daa063034703a38a8a510727ebc8f63b49cd8b3 19-Sep-2017 Yuichi Araki <yaraki@google.com> Mockito on device for Room

Bug: 65858477
Test: This fixes the test
Change-Id: I23ea0515b24c92785b0acea3cf0747108a9960d6
ndroid/arch/persistence/room/integration/testapp/test/CustomDatabaseTest.java
540e3498175652abe452d8e0ed1c252e718ddf5a 13-Sep-2017 Florina Muntenescu <florinam@google.com> Enforcing a NON NULL constraint on the PrimaryKey

Intended behaviour:
1. If a key is not autogenerated, but is Primary key or is
part of Primary key we force the developer to add @NonNull annotation
2. if a key is autogenerate, we generate NOT NULL in table spec,
but we don't require @NonNull annotation on the field itself.

Bug: 64292391
Test: EntityProcessorTest, room integration tests

Change-Id: I0b76122680a8f78080a715919e855aa7f414f700
ndroid/arch/persistence/room/integration/testapp/PKeyTestDatabase.java
ndroid/arch/persistence/room/integration/testapp/test/PrimaryKeyTest.java
ndroid/arch/persistence/room/integration/testapp/vo/ObjectPKeyEntity.java
ndroid/arch/persistence/room/integration/testapp/vo/PetCouple.java
f830f7064ab813c85b14e5abee8ef349bd7e5177 15-Sep-2017 Yigit Boyar <yboyar@google.com> Merge "Support for the collation sequences in @ColumnInfo" into oc-mr1-dev
f0d13608aae3b4700d84c1c4532abbea56ea7a28 08-Sep-2017 Chris Craik <ccraik@google.com> Paging doc codesample improvements, api cleanup

Added detail to several docs:
- Both DataSources, added invalidation code.
- All Adapters/AdapterHelpers, added DiffCallback samples
- Simplified samples by removing @NonNull/@Nullable in specific cases

Also rename loadCount -> countItems, to match with the KeyedDataSource
counting APIs.

Avoid need for LiveListAdapterUtil by using a weak reference from the
PagedList to the data presentation layer (Adapter/AdapterHelper)

Bug: 64809611
Test: ./gradlew createFlatfootDocsArchive -PofflineDocs=true

Change-Id: I2df5a9891a96e96f009a311100d7ff4b48a01d3f
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/ComplexQueryDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
abd098954d3fe996f336201ccb25884aaa34e07f 12-Sep-2017 Yigit Boyar <yboyar@google.com> Move room to use TiledDataSource

Bug: 64809611
Test: TypeAdapterStoreTest
Change-Id: Ie65a842b64af11fa8485d5c0847cc81b2de89001
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
02fd72384988665925726323665068706ecf53d8 11-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Keyed sample with save/restore, associated fixes" into oc-mr1-dev
fd4fa4a65be59806d14e4625397948da008506b4 31-Aug-2017 Chris Craik <ccraik@google.com> Keyed sample with save/restore, associated fixes

Bug:64809611
Test: room-integration-tests-testapp, paging-common, paging-runtime

Full keyed sample, and save/restore added to both the keyed
and positional samples.

Also moves DataSource#isInvalid() checks to be internal and automatic, so e.g.
DB DataSources don't need to call them manually.

Change-Id: I2c674b2d8d45151a23c953bd7d5354cd38f773ec
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
8575db83b616ee9f3c35a49a00f51cb672b82d2d 04-Sep-2017 Yuichi Araki <yaraki@google.com> Merge "Fix some integration tests for Room" into oc-mr1-dev
ef346ae131affbba6345e00d833103acc5743c8a 29-Aug-2017 Chris Craik <ccraik@google.com> Paging API refinements, and package name rework

Bug: 64809611
Test: tests in paging-runtime, paging-common, room-integration-tests

Change-Id: I1e26f130d95b31494f9a0ef734fd87594de9ddd1
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/LivePagedListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/test/ComplexQueryDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
2e9d5136685b07ef5bfabcd3936b1eedb5d24e91 25-Aug-2017 Chris Craik <ccraik@google.com> DataSource key rework

Bug: 64809611
Test: tests in paging-runtime, paging-common, room-integration-tests

Test: QueryDataSourceTest, ComplexQueryDataSourceTest, LimitOffsetDataSourceTest, KeyedDataSourceTest
All data sources now have a Key type, so that KeyedDataSource entirely
avoids positions.

Change-Id: I10ea33794621580e54876e422ffc69c3e21f453e
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LivePagedListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/test/ComplexQueryDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
e385da30d6d674daa1dccef17e5e7ccc519bc3dd 29-Aug-2017 Yigit Boyar <yboyar@google.com> Fix LivePagedListProviderTest

The test was relying on old behavior where get triggers a load. It was also
not defining the initial page size.

Bug: 65016384
Test: LivePagedListProviderTest passes

Change-Id: I7eec8693521caf3fbad241bf70ad932957552c86
ndroid/arch/persistence/room/integration/testapp/paging/LivePagedListProviderTest.java
6be69eb5aa66706ff5880e12c17ea6e62c35eda3 15-Aug-2017 Yuichi Araki <yaraki@google.com> Fix some integration tests for Room

Test: test fixes
Bug: 65138847
Change-Id: I6ad29b2aa19d0ee1e72ca9bc30d3dc4bdfb63ea1
ndroid/arch/persistence/room/integration/testapp/test/ConstructorTest.java
ndroid/arch/persistence/room/integration/testapp/test/ForeignKeyTest.java
9a31bf2f73304e0ad3f5e6a6261c7683bfeeff91 29-Aug-2017 Yuichi Araki <yaraki@google.com> Merge "InvalidationTracker.Observer for multiple tables" into oc-mr1-dev
68c65b3d9b80517aa814aa6090c99568362214ff 27-Jul-2017 Yuichi Araki <yaraki@google.com> Support for the collation sequences in @ColumnInfo

Add support for the collation sequences for database columns by putting
`collate` parameter in @ColumnInfo.

Bug: 62007004
Test: SimpleEntityReadWriteTest, FieldProcessorTest
Change-Id: I995e200038c580721e8a8088aab7268e6dd437a4
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/migration/MigrationDb.java
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
ndroid/arch/persistence/room/integration/testapp/vo/User.java
08385cfa2c450904f437f8361ec3d3553834989b 28-Aug-2017 Yuichi Araki <yaraki@google.com> InvalidationTracker.Observer for multiple tables

Fix InvalidationTracker to correctly notify a set of invalidated tables
when multiple tables are observed.

Bug: 65099281
Test: InvalidationTest, InvalidationTrackerTest
Change-Id: Ib2d1182dde844bc0169bfb8bf8eb5838102fa9d0
ndroid/arch/persistence/room/integration/testapp/test/InvalidationTest.java
2c56b466fc39da8bc5cb82dc494e534768e65eab 12-Aug-2017 shepshapard <shepshapard@google.com> Fix issue where the name of a common extension table is expected to be
observable when a Dao returns LiveData.

Bug: 62510164
Test: DaoWriterTest#updateDao,
QueryMethodProcessorTest#testLiveDataWithNothingToObserve,
QueryMethodProcessorTest#testLiveDataWithWithClauseAndNothingToObserve,
WithClauseTest#noSourceOfData,
WithClauseTest#sourceOfData,
LiveDataQueryTest#withRelationOnly,
LivedataQueryTest#withWithClause

Change-Id: Id1ac0b5d96cb7db237630dfdd4c8c8c6b502bc28
ndroid/arch/persistence/room/integration/testapp/TestDatabase.java
ndroid/arch/persistence/room/integration/testapp/dao/SpecificDogDao.java
ndroid/arch/persistence/room/integration/testapp/dao/WithClauseDao.java
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
ndroid/arch/persistence/room/integration/testapp/test/TestDatabaseTest.java
ndroid/arch/persistence/room/integration/testapp/test/WithClauseTest.java
ndroid/arch/persistence/room/integration/testapp/vo/PetsToys.java
24418e9aafa6ae3128ae47cf7087eda46dae4f5d 18-Aug-2017 Chris Craik <ccraik@google.com> Revert "Revert "Paging refactor to unify list/data source types, and simplify mutability""

bug:64838013

Fixed build breakage.

This reverts commit c051b0691f4363110fb3d62193a114b04a8ef344.

Change-Id: I4fd2442d185b4b107e2db45c402f79ed9948bc38
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LiveLazyListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LivePagedListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/test/ComplexQueryDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
c051b0691f4363110fb3d62193a114b04a8ef344 18-Aug-2017 Chris Craik <ccraik@google.com> Revert "Paging refactor to unify list/data source types, and simplify mutability"

bug:64838013 Fix build breakage

This reverts commit 1cb45e73a41f91534febb7e5d799e1f703fb3763.

Change-Id: I88d2c954f48f1c6693ccfc31b3b62a37c5abac9a
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LiveLazyListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LivePagedListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/test/ComplexQueryDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
1cb45e73a41f91534febb7e5d799e1f703fb3763 15-Jul-2017 Chris Craik <ccraik@google.com> Paging refactor to unify list/data source types, and simplify mutability

Bug: 64809611
Test: new tests passing

- Unified list type for contiguous data sources - null padding is created at initialization, and
consumed as items are loaded. Infinite unpadded, and counted padded lists use same list type
entirely.

- New list and DataSource type for tiled data sources, which can access data at any location.

- Split data source based on keyed vs tiled based implementations. This massively simplified the
few existing data sources, and allowed us to specialize further, making the trivial test (and
limit-offset) code much simpler (and avoiding code that was extremely prone to off by one errors)

- Added PagedListAdapter, which provides convenience wrapper for the AdapterHelper, saving users a
few extra lines of code.

- Uncountable positioning - rework also has relative data source position stored at initialization
so that countable items can use position, without being required to count their dataset. This
supports cases with simple position IDs, but where you: 1) don't want nulls in the data, 2) don't
care about count/scrollbars, 3) can't easily compute the total number.

- PagedList requires data to initialize - Removes need for weird warmup API, avoids showing a list
of nulls to user in countable case, and unifies initialization codepaths.

- PagedList has a snapshot() method that enables DiffUtil to run safely on a background thread on
immutable data, and snapshot-aware diffing that allows a new list to load content while it's being
used in diffing on a background thread.

Not done:

- Parameterized initialization (both init from key, storing key, passing key when creating LiveData<PagedList>)

Change-Id: I7cb945afe37e68aad44cde45277afd7a27416e52
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LiveLazyListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LivePagedListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/test/ComplexQueryDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
b2bfd37e6320e795bffafe24cfdc6a1d1b3da035 21-Jul-2017 Yuichi Araki <yaraki@google.com> NOT NULL constraint by @NonNull

NonNull entity fields automatically have NOT NULL constraint in SQLite.

A field is regarded as NonNull when it is either one of these:
- A primitive type
- Annotated with @android.support.annotation.NonNull
- Annotated with @org.jetbrains.annotations.NotNull

Bug: 62007004
Test: SimpleEntityReadWriteTest, EntityProcessorTest
Change-Id: I1d06a89874e8804cca87736573eb0b81166bbab0
ndroid/arch/persistence/room/integration/testapp/TestDatabase.java
ndroid/arch/persistence/room/integration/testapp/dao/ProductDao.java
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
ndroid/arch/persistence/room/integration/testapp/vo/Product.java
720567eba70634b9d4efa27e29a3c2bab2bd2a52 26-Jul-2017 Yuichi Araki <yaraki@google.com> Merge "Fix InvalidationTracker for custom database" into oc-support-26.0-dev
f24ecb4d1edf2073d12bf350ae4acf318167402a 25-Jul-2017 Yigit Boyar <yboyar@google.com> Merge "Room: Throw if migration is missing." into oc-support-26.0-dev
234f073e2227fcb62a9ed8285c79724de1f0fa92 24-Jul-2017 Yigit Boyar <yboyar@google.com> Room: Throw if migration is missing.

This CL changes the default behavior of Room when a migration is missing.
Previously, we would just clear the database, now we crash.

Developer can opt-in to the clearing behavior by calling the builder
API.

Bug: 63872392
Test: BuilderTest, MigrationTest
Change-Id: I8cdbc42ec0360f2b3354bbeae4e7b718a6ef1fe7
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
14bd6a8aff57a55980159ae8b5cbdb8713725ab7 24-Jul-2017 Florina Muntenescu <florinam@google.com> Adding a constructor with 2 params for the MigrationTestHelper.
Bug: 63130998
Test: MigrationTest

Change-Id: Ib1d0d117df12d736e139750252a74af0860823cc
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
62de5e0b4c4f0498e0af8a88eda5696241441ef0 24-Jul-2017 Yuichi Araki <yaraki@google.com> Merge "Fix migration with autoincrement primary key" into oc-support-26.0-dev
bd9f55f9e165d36f944666d5c2a9ccc170e56dc4 22-Jul-2017 Yigit Boyar <yboyar@google.com> Merge "Keep list size variables list for DELETE|UPDATE queries" into oc-support-26.0-dev
5843a353d7d4740a2d6119fdd90f258f645f4f20 13-Jul-2017 Yuichi Araki <yaraki@google.com> Fix InvalidationTracker for custom database

InvalidationTracker queries the database when something changes, but
this can cause exception when the database is closed during the query is
being run. We prevent this by catching the exception, but that's not
enough for custom database implementation as it might throw some types
of exception we don't know about.

This CL introduces a close lock between RoomDatabase and
InvalidationTracker. As far as the database is closed with
RoomDatabase.close(), InvalidationTracker can tell that it is being
closed and stop querying it.

We still need to catch IllegalStateException and SQLiteException because
some tests have to close the underlying SupportSQLiteDatabase bypassing
RoomDatabase and currently there's no way InvalidationTracker can hook
into it.

Bug: 63162311
Test: CustomDatbaseTest
Change-Id: Iece7f95eac886287ea09d69ed44cba786340872b
ndroid/arch/persistence/room/integration/testapp/test/CustomDatabaseTest.java
63e44ca6060a78f1313a4946655f6f0471681867 21-Jul-2017 Yuichi Araki <yaraki@google.com> Fix migration with autoincrement primary key

Ignore the special SQLite3 table `sqlite_sequence` in validation for
unreferenced tables.

Bug: 63393618
Test: MigrationTest
Change-Id: I93748b83970022aca156a6a3005df0de6fc57279
ndroid/arch/persistence/room/integration/testapp/migration/MigrationDb.java
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
c890c012cd74887025f69a23478bda304076d049 20-Jul-2017 Yigit Boyar <yboyar@google.com> Read relationships while reading fields

This CL fixes a bug where if a Relationship is inside an embedded item,
we would try to set it in the root object.

With this CL, we actually read and set it while reading the embedded
item.

Bug: 63736065
Test: PojoWithRelationTest
Change-Id: I5a49523695498299ac4ddd198e7090bd31a1b65d
ndroid/arch/persistence/room/integration/testapp/dao/UserPetDao.java
ndroid/arch/persistence/room/integration/testapp/test/PojoWithRelationTest.java
ndroid/arch/persistence/room/integration/testapp/vo/EmbeddedUserAndAllPets.java
d9a1c84670c4f684943c23efc8813c20ef965eca 20-Jul-2017 Yigit Boyar <yboyar@google.com> Keep list size variables list for DELETE|UPDATE queries

This CL fixes a bug where we would assume that @Query annotations that
run DELETE or UPDATE queries would not receive any arguments. This was
caused because no-arg queries are prepared separately.

Bug: 63872538
Test: SimpleEntityReadWriteTest
Change-Id: I87883a9d67932f0176e6e0f26ef8bd071633f34b
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
a595f18019fa63b75fadc2c9a36f85503ca8b94b 18-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix @Query without any parameters" into oc-support-26.0-dev
c99ef3ade9237f0ff7ad006351940e0b1a473383 18-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix integration-tests for Room" into oc-support-26.0-dev
d4fdfb653308477ad94b64dc976e43041036dfd1 18-Jul-2017 Yuichi Araki <yaraki@google.com> Fix integration-tests for Room

Remove multidex. Fix MigrationTest.

Test: All tests in integration-tests:testapp
Change-Id: Icbfdbaa45344f51e9fe7e2dff171fa279575d60f
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
e088306a4368329d3e00b3da0f4682fc37e54cb8 13-Jul-2017 Yuichi Araki <yaraki@google.com> Fix @Query without any parameters

Bug: 63608092
Test: SimpleEntityReadWriteTest and DaoWriterTest
Change-Id: I9998c18ea2f16501ea57925d6e5b0605ba2f946b
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
0cf0bfe0e88f5d511a2a23495005c2da9ea91fd5 17-Jul-2017 Yigit Boyar <yboyar@google.com> Add support for Maybe and Single

Bug: 62231019
Test: RxJava2Test
Change-Id: Ib747eec847bb22b24b945fa3cfa9c2ea7ef69716
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/RxJava2Test.java
85ca93db24df5965a7f248ee716442f69ae2e265 14-Jul-2017 Chris Craik <ccraik@google.com> Merge "Initial commit of paging component." into oc-support-26.0-dev
f56bb2fe802df5609c01012f0b4c46041603428e 14-Jul-2017 Sergey Vasilinets <sergeyv@google.com> Speculative fix for LiveDataQueryTest.handleGc

Test: LiveDataQueryTest#handleGc
Change-Id: Ie8b3ac933b0ca5d0333cef79744988bcfbb216f2
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
9fd8e6171bbdc37f5516fe15b2d96f4ae926ef1a 23-Jun-2017 Chris Craik <ccraik@google.com> Initial commit of paging component.

This commit introduces a paging component to enable gradual, lazy
loading from large data sources, including Room queries.

The primary entry points are:

1) CountedDataSource, the base class for defining a countable (i.e.
fixed, known size) source of items, such as a Database query.

2) LazyList, the lazy-loading List-like component which pages content
in on a background thread from a CountedDataSource.

3) LiveLazyListProvider, the class which produces DataSources, and
presents a LiveData<LazyList<T>>.

4) LazyListAdapterHelper, which takes a LiveData<LazyList>, and
presents the data simply to an adapter. It computes differences
between versions with DiffUtil, and signalling updates to the adapter.

Currently, Room only presents a limit-offset query as an easy means to
get a LiveData of a LazyList, but it's possible to write a custom data
source to page in data from keyed (including composite-keyed) queries.

Test: new tests
Change-Id: I415879a032d83786d734c26c429828da3b8bc76a
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/paging/LiveLazyListProviderTest.java
ndroid/arch/persistence/room/integration/testapp/test/ComplexQueryDataSourceTest.java
ndroid/arch/persistence/room/integration/testapp/test/QueryDataSourceTest.java
e4f10a8bf64e8a672b4ac57e482735d5ec76c4c8 12-Jul-2017 Aurimas Liutikas <aurimas@google.com> Mark LiveDataQueryTest#handleGc medium so it does not block presubmit.

This test is flaking on presubmit blocking changes from landing.

Test: None
Change-Id: I96a4aa99670146184b7efb78c0d95012310b531d
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
85b81aedb3f8ed5482bebaeddc6265e785b8202b 12-Jul-2017 Yuichi Araki <yaraki@google.com> Merge "Add RoomDatabase.Callback" into oc-support-26.0-dev
cf4d34906517d8ced296a96e50339c926a7dfdcd 30-Jun-2017 Yuichi Araki <yaraki@google.com> Add RoomDatabase.Callback

Users can now add Callbacks to RoomDatabase.

Bug: 62699324
Test: DatabaseCallbackTest
Change-Id: I0fa38ba97614e1ad721594d238960b8183e96769
ndroid/arch/persistence/room/integration/testapp/test/DatabaseCallbackTest.java
a705df8d15857046453d2670213afcd7cd9462d8 12-Jul-2017 Yigit Boyar <yboyar@google.com> Move to the counting executor to speedup tests.

Bug: 63513657
Test: existing tests pass
Change-Id: I1808a3cfbfe21036603dbc95f53a1663af30e3da
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
84febb5a3fe9590400d00cbb953a634e6c233cc1 12-Jul-2017 Ian Lake <ilake@google.com> Make LiveDataQueryTest.handleGc a MediumTest

Avoid running the handleGc test on presubmit by
making it a MediumTest

Test: ran the test
BUG: 63513657
Change-Id: Idbb4f10152b5a6c3bd6e6942dd6b9d54226629be
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
2bc5b84ed32ea5d4643a3e7fc50fb4e8086c2df1 10-Jul-2017 Yigit Boyar <yboyar@google.com> Add tests for GC.

Bug: 63513657
Test: LiveDataQueryTest, InvalidationTrackerTest
Change-Id: I6d7a6efc5b180236e6f41dd44049397af3f5c151
ndroid/arch/persistence/room/InvalidationTrackerTrojan.java
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
aa4decb2298d680bae12333764b3bccd859c76ac 10-Jul-2017 Yigit Boyar <yboyar@google.com> Merge "Revert "Make ComputableLiveData a real LiveData"" into oc-support-26.0-dev
f59164365fb6de9f148b597af5a6e19b3b7c8c2e 10-Jul-2017 Yigit Boyar <yboyar@google.com> Revert "Make ComputableLiveData a real LiveData"

This reverts commit d58f4645f2a8bf29a5e62f7dceceb7b4da9ff337.

Change-Id: I3bd24ed09bdcc63db98a0cdf4f401f2bf682aefe
ndroid/arch/persistence/room/InvalidationTrackerTrojan.java
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
97d8e7f3c524b1bc986c9c86f0f92bd8831890a3 10-Jul-2017 Yigit Boyar <yboyar@google.com> Merge "Make ComputableLiveData a real LiveData" into oc-support-26.0-dev
d58f4645f2a8bf29a5e62f7dceceb7b4da9ff337 28-Jun-2017 Yigit Boyar <yboyar@google.com> Make ComputableLiveData a real LiveData

This CL removes the intermediate ComputableLiveData class which
was not a live data :/.

I've also added more tests to ensure that we are handling GC
properly (we were).

Bug: 63513657
Test: LiveDataQueryTest, ComputableLiveDataTest, InvalidationTrackerTest
Change-Id: I9be2330d8009014a1147b6f3ec8aac67b06229ab
ndroid/arch/persistence/room/InvalidationTrackerTrojan.java
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
86b3f8d9bd637749668174e0736fe9fbecbcfb09 27-Jun-2017 Yuichi Araki <yaraki@google.com> Multiple Entities in Insert, Update and Delete

Dao can now have @Insert, @Update and @Delete methods with more than one
types of Entities.

Bug: 62682405
Test: SimpleEntityReadWriteTest, *ProcessorTests
Change-Id: Ib2f1afabff237f26d250b3fcf7b2fdf50d01ecff
(cherry picked from commit 77d77afb0cde4df833c6d10f641de2dc81f859b8)
ndroid/arch/persistence/room/integration/testapp/dao/PetDao.java
ndroid/arch/persistence/room/integration/testapp/dao/UserPetDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
bccb62d8b52e4683318329411928156997ecb405 26-Jun-2017 Yuichi Araki <yaraki@google.com> BLOB byte array in Query methods

Bug: 62460045
Test: SimpleEntityReadWriteTest
Change-Id: I8022bc7b817e2e949d6d28051beff31419b2e4cc
ndroid/arch/persistence/room/integration/testapp/TestDatabase.java
ndroid/arch/persistence/room/integration/testapp/dao/BlobEntityDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
ndroid/arch/persistence/room/integration/testapp/vo/BlobEntity.java
64cba1f9990a73204dda5f24fdbf249926acc2e0 14-Jun-2017 Yuichi Araki <yaraki@google.com> Add RoomDatabase.runInTransaction

Test: SimpleEntityReadWriteTest
Bug: 38488747
Change-Id: I253b69fa8dcd281c5e4b1665bf2955e65455b192
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
e7aea42491c810542ee3f8d9b106d5b8e14bdd14 07-Jun-2017 Yigit Boyar <yboyar@google.com> Change migration test helper to receive instrumentation instance

MigrationTestHelper was trying to open the database in the
test context which does not seem to work in some cases.

Just getting the Instrumentation as an input and using the target
context to open to db solves the problem.

Bug: 62409449
Test: MigrationTest
Change-Id: Ic21baa4853414c78cb365717d38968fbf967c8c6
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
c7ec99790d7ae8bdd0cf88b43c3516f667e2fb59 03-Jun-2017 Yigit Boyar <yboyar@google.com> add test for empty in query

Bug: 36023544
Test: SimpleReadWriteTest#emptyInQuery
Change-Id: Idd9aa05c53a33785d4a31a75b9a73af880f4faf0
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
2ec1285ef79d4849069efe95cfbac2307d291a47 31-May-2017 Yuichi Araki <yaraki@google.com> InvalidationTracker now passes invalidated tables

This allows developers to observe multiple tables at the same time and
get notified of which table was actually invalidated.

Bug: 38468740
Test: InvalidationTrackerTest, InvalidationTest, RxRoomTest
Change-Id: I6c2a8c36417c4d9b223a03a54ff5183f17974ab2
ndroid/arch/persistence/room/integration/testapp/test/InvalidationTest.java
24b0c2d5bde2848da5caa57d9b1ec2a95d12bcd9 31-May-2017 Yuichi Araki <yaraki@google.com> Fix ForeignKeyTest on API 15 and below

The error message about foreign key constraint has changed from time to
time. This test was failing on API level 14 and 15.

The error message is:
api14: ERROR CODE 19: CONSTRAINT FAILED
api18: FOREIGN KEY CONSTRAINT FAILED (CODE 19)
api21: FOREIGN KEY CONSTRAINT FAILED (CODE 787)

Test: This is a test
Change-Id: Icf2aff95fed7894a18898b671d359f4beccdfe80
ndroid/arch/persistence/room/integration/testapp/test/ForeignKeyTest.java
e185ed6ba937bdc218104c18d2615e1ce524adb7 27-May-2017 Yigit Boyar <yboyar@google.com> Simpler SQLite interface

This CL reduces the API surface of the SupportSQLiteDatabase not to include
factory methods or methods. It also changes query methods that receive
String[] to Object[] to workaround the binding bug.

This is still not enough as it depends on android classes. We may later
further reduce this to use no-android APIs but that api will look very
limited unless we can use default methods (which requres android
gradle plugin 3.0 that is not stable right now).

I've also added a simple QueryBuilder to replace methods in the SQLiteDatabase
that receive a million arguments.

Bug: 38481640
Test: existing tests pass
Change-Id: I37dc666235fa31877725d85cc98fb01542d4638a
ndroid/arch/persistence/room/integration/testapp/migration/MigrationDb.java
1676c28584028f8427475745d7a779607af67ecb 29-May-2017 Yigit Boyar <yboyar@google.com> Consider nullable types for known column types

When we can get the column type from sqlite at compile time,
we were only considering primitives which is a problem since
the column might be nullable.

This CL fixes that issue by adding nullables into the list.

I've also removed the conveters from basic type to/from string
since it was only useful when we were using the old sqlite API
that requires parameters to be strings. Right now, it just
serves as a misleading edge between type nodes.

Bug: 62100716
Test: TypeAdapterStoreTest, SimpleReadWriteTest
Change-Id: Ifb9c9d41aa694d7a3e1a04b617bbe3dc6e473839
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
4d4bae3f216e55f824d7d7fbfe2f8861906ee3e2 04-May-2017 Yigit Boyar <yboyar@google.com> s/decompose/embedded

Bug: 37999488
Test: existing test pass
Change-Id: Iafd5ff1a00bea99041f6bef6e70e6050f3b6329d
ndroid/arch/persistence/room/integration/testapp/test/ConstructorTest.java
ndroid/arch/persistence/room/integration/testapp/test/DecompositionTest.java
ndroid/arch/persistence/room/integration/testapp/test/EmbeddedTest.java
ndroid/arch/persistence/room/integration/testapp/vo/Address.java
ndroid/arch/persistence/room/integration/testapp/vo/PetAndToys.java
ndroid/arch/persistence/room/integration/testapp/vo/PetCouple.java
ndroid/arch/persistence/room/integration/testapp/vo/School.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndAllPets.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndPet.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndPetNonNull.java
ndroid/arch/persistence/room/integration/testapp/vo/UserWithPetsAndToys.java
3542101509120586bbae17b1f748f302e1fb82a3 04-May-2017 Yigit Boyar <yboyar@google.com> Don't allow anonymous bind parameters.

Bug: 37990862
Test: existing tests pass
Change-Id: I3db2de89a4f46acf1396af4e1d3793bd2def6aec
ndroid/arch/persistence/room/integration/testapp/PKeyTestDatabase.java
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/dao/UserPetDao.java
ndroid/arch/persistence/room/integration/testapp/test/ForeignKeyTest.java
2e8d5608ba4b3da0a05d6b6cc23d81fe10371970 02-May-2017 Yigit Boyar <yboyar@google.com> Don't allow main thread queries

This CL adds assertions not to run main thread queries in Room.

Bug: 32342709
Test: MainThreadCheckTest
Change-Id: Ib776fa7d1b3a5571008d8804ca9f373cb007101d
ndroid/arch/persistence/room/integration/testapp/test/MainThreadCheckTest.java
b86bef286718da421268bc52cf4fab7cccb3104c 22-Apr-2017 Sergey Vasilinets <sergeyv@google.com> Make Event an Enum

bug:37571769
Test: refactoring CL.
Change-Id: I30316d3ccecd7720b90968957dcab75c71443d5d
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
64db0cc15b78b62a1d44a70fc8b4552e660d952c 17-Apr-2017 Yigit Boyar <yboyar@google.com> Mass package renaming from android.support to android.arch

Bug: 37429162
Test: ./gradlew check passes

Change-Id: I911766254b6a9f957ef90429a1efc01c209d693a
ndroid/arch/persistence/room/integration/testapp/PKeyTestDatabase.java
ndroid/arch/persistence/room/integration/testapp/TestDatabase.java
ndroid/arch/persistence/room/integration/testapp/dao/PetCoupleDao.java
ndroid/arch/persistence/room/integration/testapp/dao/PetDao.java
ndroid/arch/persistence/room/integration/testapp/dao/SchoolDao.java
ndroid/arch/persistence/room/integration/testapp/dao/ToyDao.java
ndroid/arch/persistence/room/integration/testapp/dao/UserDao.java
ndroid/arch/persistence/room/integration/testapp/dao/UserPetDao.java
ndroid/arch/persistence/room/integration/testapp/migration/MigrationDb.java
ndroid/arch/persistence/room/integration/testapp/migration/MigrationTest.java
ndroid/arch/persistence/room/integration/testapp/test/ConstructorTest.java
ndroid/arch/persistence/room/integration/testapp/test/DecompositionTest.java
ndroid/arch/persistence/room/integration/testapp/test/ForeignKeyTest.java
ndroid/arch/persistence/room/integration/testapp/test/IdentityDetectionTest.java
ndroid/arch/persistence/room/integration/testapp/test/IndexingTest.java
ndroid/arch/persistence/room/integration/testapp/test/InvalidationTest.java
ndroid/arch/persistence/room/integration/testapp/test/LiveDataQueryTest.java
ndroid/arch/persistence/room/integration/testapp/test/PojoTest.java
ndroid/arch/persistence/room/integration/testapp/test/PojoWithRelationTest.java
ndroid/arch/persistence/room/integration/testapp/test/PrimaryKeyTest.java
ndroid/arch/persistence/room/integration/testapp/test/RxJava2Test.java
ndroid/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
ndroid/arch/persistence/room/integration/testapp/test/TestDatabaseTest.java
ndroid/arch/persistence/room/integration/testapp/test/TestUtil.java
ndroid/arch/persistence/room/integration/testapp/vo/Address.java
ndroid/arch/persistence/room/integration/testapp/vo/AvgWeightByAge.java
ndroid/arch/persistence/room/integration/testapp/vo/Coordinates.java
ndroid/arch/persistence/room/integration/testapp/vo/IntAutoIncPKeyEntity.java
ndroid/arch/persistence/room/integration/testapp/vo/IntegerAutoIncPKeyEntity.java
ndroid/arch/persistence/room/integration/testapp/vo/Pet.java
ndroid/arch/persistence/room/integration/testapp/vo/PetAndToys.java
ndroid/arch/persistence/room/integration/testapp/vo/PetCouple.java
ndroid/arch/persistence/room/integration/testapp/vo/School.java
ndroid/arch/persistence/room/integration/testapp/vo/SchoolRef.java
ndroid/arch/persistence/room/integration/testapp/vo/Toy.java
ndroid/arch/persistence/room/integration/testapp/vo/User.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndAllPets.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndPet.java
ndroid/arch/persistence/room/integration/testapp/vo/UserAndPetNonNull.java
ndroid/arch/persistence/room/integration/testapp/vo/UserIdAndPetNames.java
ndroid/arch/persistence/room/integration/testapp/vo/UserWithPetsAndToys.java
om/android/support/room/integration/testapp/PKeyTestDatabase.java
om/android/support/room/integration/testapp/TestDatabase.java
om/android/support/room/integration/testapp/dao/PetCoupleDao.java
om/android/support/room/integration/testapp/dao/PetDao.java
om/android/support/room/integration/testapp/dao/SchoolDao.java
om/android/support/room/integration/testapp/dao/ToyDao.java
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/dao/UserPetDao.java
om/android/support/room/integration/testapp/migration/MigrationDb.java
om/android/support/room/integration/testapp/migration/MigrationTest.java
om/android/support/room/integration/testapp/test/ConstructorTest.java
om/android/support/room/integration/testapp/test/DecompositionTest.java
om/android/support/room/integration/testapp/test/ForeignKeyTest.java
om/android/support/room/integration/testapp/test/IdentityDetectionTest.java
om/android/support/room/integration/testapp/test/IndexingTest.java
om/android/support/room/integration/testapp/test/InvalidationTest.java
om/android/support/room/integration/testapp/test/LiveDataQueryTest.java
om/android/support/room/integration/testapp/test/PojoTest.java
om/android/support/room/integration/testapp/test/PojoWithRelationTest.java
om/android/support/room/integration/testapp/test/PrimaryKeyTest.java
om/android/support/room/integration/testapp/test/RxJava2Test.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
om/android/support/room/integration/testapp/test/TestDatabaseTest.java
om/android/support/room/integration/testapp/test/TestUtil.java
om/android/support/room/integration/testapp/vo/Address.java
om/android/support/room/integration/testapp/vo/AvgWeightByAge.java
om/android/support/room/integration/testapp/vo/Coordinates.java
om/android/support/room/integration/testapp/vo/IntAutoIncPKeyEntity.java
om/android/support/room/integration/testapp/vo/IntegerAutoIncPKeyEntity.java
om/android/support/room/integration/testapp/vo/Pet.java
om/android/support/room/integration/testapp/vo/PetAndToys.java
om/android/support/room/integration/testapp/vo/PetCouple.java
om/android/support/room/integration/testapp/vo/School.java
om/android/support/room/integration/testapp/vo/SchoolRef.java
om/android/support/room/integration/testapp/vo/Toy.java
om/android/support/room/integration/testapp/vo/User.java
om/android/support/room/integration/testapp/vo/UserAndAllPets.java
om/android/support/room/integration/testapp/vo/UserAndPet.java
om/android/support/room/integration/testapp/vo/UserAndPetNonNull.java
om/android/support/room/integration/testapp/vo/UserIdAndPetNames.java
om/android/support/room/integration/testapp/vo/UserWithPetsAndToys.java
f8c3624579d5761a2d34a7199932492d267f5f85 10-Apr-2017 Yigit Boyar <yboyar@google.com> Add support for arg constructors

This CL adds constructor support to Pojo and Entity processors.
We try to map each constructor parameter to a field based on
its name. If there are conflicts, we fail the compilation.
If there are multiple matching constructors, we fail the compilation
and developer can annotate unwanted ones with @Ignore to workaround
the issue.

This CL also prioritizes PojoRowAdapter over EntityRowAdapter since
it is faster and proguard does a good job on shrinking the generated
code.

Bug: 34611719
Bug: 36473441
Bug: 34754519
Test: ConstructorTest, PojoProcessorTest

Change-Id: I70592b129c7dcb9cacfb072b2c63169630eadf9a
om/android/support/room/integration/testapp/TestDatabase.java
om/android/support/room/integration/testapp/test/ConstructorTest.java
om/android/support/room/integration/testapp/test/ForeignKeyTest.java
om/android/support/room/integration/testapp/vo/AvgWeightByAge.java
489d61a70a742408cda5ca1a4d9788b9f14282a0 11-Apr-2017 Yigit Boyar <yboyar@google.com> Make invalidation tracker test friendly

This CL guards invalidation tracker from unwated failures which
can happen when database is closed.

Bug: 37160100
Test: InvalidationTrackerTest
Change-Id: I53511d89ab30f3dba01bac069a224c3fd5bc1ec0
om/android/support/room/integration/testapp/migration/MigrationTest.java
3c592c4ccbc6052b11443b0fa575052c08fefa55 04-Apr-2017 Yigit Boyar <yboyar@google.com> Room RxJava2 Support, Step 1

This CL adds support for returning Flowable & Publisher from
Room DAO queries. We may introduce an Optional support later
for nullable queries.

I've also changed live data check to use type utils instead of string
matching.

Bug: 37009497
Test: RxRoomTest, RxJava2Test
Change-Id: I00e10efcf7599f3d33cd7e4b6b638b546fb5c1e9
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/RxJava2Test.java
36023a6ffdcc24a64c3f86efd4e754cfc3493761 07-Apr-2017 Yigit Boyar <yboyar@google.com> Fix failing tests on API <20

ForeignKeyTest was failing due to a case sensitive comparison
TableInfo test was failing because older sqlite versions do not provide
primary key order. To overcome that, we are now relying on just being a
primary key while doing TableInfo comparison.

Test: TableInfoTest, ForeignKeyTest
Bug: 37105021
Change-Id: Iba4dafc093f5af1920e19911f8fa6112e3603503
om/android/support/room/integration/testapp/test/ForeignKeyTest.java
ebdeee2c668f632384a7c9b3a098f0cccf88e7cd 03-Apr-2017 Yigit Boyar <yboyar@google.com> Foreign keys step 3, verification

Adds foreign key verification to the migration helper and
also adds the foreign key information into the exported
bundle.
The conversions between the exported bundle and the
TableInfo is looking unnecssary but keeping it for now
since it gives us the flexibility between the compile time
representation of the schema and runtime representation
(which is limited).

Bug: 36602348
Test: MigrationTest, TableInfoTest
Change-Id: If40fe520c9930493502cddac3e6c747ef26610df
om/android/support/room/integration/testapp/migration/MigrationDb.java
om/android/support/room/integration/testapp/migration/MigrationTest.java
0045a1c980b44c882f4ece571a0a113d36bbf0fb 31-Mar-2017 Yigit Boyar <yboyar@google.com> foreign key step 2

This CL adds instrumentation tests for foreign key and code generation.
There is no schema validation yet, it will be in the next CL.

Bug: 36776636
Test: ForeignKeyTest.java
Change-Id: I88d83bb9b43cbf0da5273b31f5b7571b2b927622
om/android/support/room/integration/testapp/test/ForeignKeyTest.java
6728af1603c6082a13533b830a9ef0bbc51ba827 30-Mar-2017 Yigit Boyar <yboyar@google.com> Revert "Use . notation in indices"

This reverts commit e58a8289a82132d557d38d02eb23ade42d0c6328.

Reason for revert: Using . notation just looks like a leaky abstraciton.
We better try to solve this in a more well defined way.

Bug: 36023623
Test: Existing tests pass

Change-Id: Id336df7c8909353ffa6e4036e811fc0ff91699f1
om/android/support/room/integration/testapp/test/IndexingTest.java
f385ca501bbfd3ccaf6b412f8f09c64d9ee742f2 30-Mar-2017 Yigit Boyar <yboyar@google.com> Use column names in relationships.

The . notation in relationships leaks the private fields of Entities.
Instead, use column names.

Bug: 34258173
Test: existing tests pass
Change-Id: I37b3b6bb90d2807e680304414a629274dc98cd40
om/android/support/room/integration/testapp/vo/PetAndToys.java
om/android/support/room/integration/testapp/vo/UserAndAllPets.java
om/android/support/room/integration/testapp/vo/UserIdAndPetNames.java
om/android/support/room/integration/testapp/vo/UserWithPetsAndToys.java
3a433f7ddbffa6131883cc3b23fc80edf54add19 26-Mar-2017 Yigit Boyar <yboyar@google.com> Validate migration

This CL adds necessary code to validate database integrity after a
migration. This way, if developer does not implement migration
properly, Room will throw an exception.

Test: TableInfoTest, MigrationTest
Bug: 36602348
Change-Id: Id335875387a740344deb76778c5df6978b0212a5
om/android/support/room/integration/testapp/migration/MigrationDb.java
om/android/support/room/integration/testapp/migration/MigrationTest.java
e13540a25fe5460240b6db0e18858c32d16f5399 31-Mar-2017 Sergey Vasilinets <sergeyv@google.com> Rename LifecycleProvider to LifecycleOwner

Test: refactoring CL.
Change-Id: I89eb662487cd1ca786829defcf90fbc2fb4af001
om/android/support/room/integration/testapp/test/LiveDataQueryTest.java
a64756a18111a7312b3fa03b76d13381a8907176 21-Mar-2017 Yigit Boyar <yboyar@google.com> Room Migrations, Step 1

This CL adds ability to specify migration callbacks.
Developer can specify a list of migrations while building the database
and Room will run them. If a path cannot be found, Room will nuke the
database and recreate.

This CL moves the "version" parameter of the database from the
builder into the annotation. This allows us to export the schema
at compile time to be used later.

This CL also introduces a new "testing" package for Room which is
capable of initializing the database based on the exported schema.
This can be used by the developers to create the database in a
previous schema and migrate to the current one.

Test: MigrationTest, BuilderTest, TableInfoTest
Bug: 36602348
Change-Id: I7d543b20410b14ff61ef1b433c38c44009c86e8d
om/android/support/room/integration/testapp/PKeyTestDatabase.java
om/android/support/room/integration/testapp/TestDatabase.java
om/android/support/room/integration/testapp/migration/MigrationDb.java
om/android/support/room/integration/testapp/migration/MigrationTest.java
om/android/support/room/integration/testapp/test/IndexingTest.java
2fa2ccde296e35f2850b227065c27f27e74bce10 06-Mar-2017 Yigit Boyar <yboyar@google.com> Use . notation in indices

This CL changes Index annotation to match fields via their names instead
of column names. This makes it consistent with @Relation and makes it
easy to handle decomposed field indices.

Bug: 35846503
Test: EntityProcessorTest.kt
Change-Id: I43a11564f1ceb52ba95790194a787dce3ede1d1c
om/android/support/room/integration/testapp/test/IndexingTest.java
f5f2cf6b9ed63915448e81551e4b7bb72a26030e 14-Mar-2017 Yigit Boyar <yboyar@google.com> Allow returning id from insert queries.

Bug: 33427828
Test: PrimaryKeyTest.java
Change-Id: I8cbf368b1282f07e3526d1902153946d12e26b3a
om/android/support/room/integration/testapp/PKeyTestDatabase.java
om/android/support/room/integration/testapp/test/PrimaryKeyTest.java
abd1282bf69658247b310982d529aa48a9466cf4 08-Mar-2017 Yigit Boyar <yboyar@google.com> Fix flaky test

This CL fixes the invalidation test to use a single threaded IO
executor so that we can easily wait on it.

Bug: 34774357
Test: InvalidationTest.java
Change-Id: If03a7af1c14b857b0747236251fddc2c6c78c7f9
om/android/support/room/integration/testapp/test/InvalidationTest.java
092164e5501d0a254001225acd9dca42e5fa57e9 26-Feb-2017 Yigit Boyar <yboyar@google.com> Add @Relation annotation to easily fetch 1-N relationships

This CL adds the @Relation annotation which can be used in
Pojo to fetch sub relationships. Right now, it only supports
1-N relationships but can easily be extended to support
N-N and 1-1 in later CLs.

Bug: 34258173
Test: PojoProcessorTest, PojoWithRelationTest

Change-Id: Ie91fd40c383dfcbffd583f0e7945813d7ec4f4f1
om/android/support/room/integration/testapp/TestDatabase.java
om/android/support/room/integration/testapp/dao/PetDao.java
om/android/support/room/integration/testapp/dao/ToyDao.java
om/android/support/room/integration/testapp/dao/UserPetDao.java
om/android/support/room/integration/testapp/test/LiveDataQueryTest.java
om/android/support/room/integration/testapp/test/PojoWithRelationTest.java
om/android/support/room/integration/testapp/test/TestDatabaseTest.java
om/android/support/room/integration/testapp/test/TestUtil.java
om/android/support/room/integration/testapp/vo/PetAndToys.java
om/android/support/room/integration/testapp/vo/Toy.java
om/android/support/room/integration/testapp/vo/UserAndAllPets.java
om/android/support/room/integration/testapp/vo/UserIdAndPetNames.java
om/android/support/room/integration/testapp/vo/UserWithPetsAndToys.java
fa3905934508aa143d899cb9b62b3b074748c9e9 06-Mar-2017 Yigit Boyar <yboyar@google.com> Verify database after opened

Room now keeps an identity hash on the database and checks it when database
is open to ensure that the schema matches the current one. If not, developer
probably forgot to update the version number so it crashes.

Bug: 35804916
Test: IdentityDetectionTest.java
Change-Id: I441cbb3e78d88874406806af6c36917d1bf0142c
om/android/support/room/integration/testapp/test/IdentityDetectionTest.java
946daad80cb572453cefc343fc0cbb9f812d9cd8 06-Mar-2017 Yigit Boyar <yboyar@google.com> Allow returning Cursor from queries

This CL adds ability to return Cursor from queries.

Bug: 32342709
Test: SimpleEntityReadWriteTest#readViaCursor
Change-Id: Ibaf8a46a5b8139681eb473f12c76445d6b7e1e62
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
2c6462f129bf43965ed8b054b026f6a28fe6fd8f 23-Feb-2017 Yigit Boyar <yboyar@google.com> Primary Key improvements

This CL changes @PrimaryKey sytax to disallow multiple fields with
@PrimaryKey annotations. Instead, it enforces using
@Entity#primaryKeys to declare composite primary keys.

This CL also fixes the inheritance rules around PrimaryKeys such that
we'll inherit primary key from super Entity / Pojo if the Entity itself
does not declare any primary keys. If the entity declares a primary
key, the parent key is dropped with a NOTE level log.

Bug: 35706557
Test: EntityProcessorTest#primaryKey*, PrimaryKeyTest.kt
Test: SQLiteOpenHelperWriterTest.kt
Change-Id: Ifcfccf29da21395586e539d0f9b130c7537e5384
om/android/support/room/integration/testapp/PKeyTestDatabase.java
om/android/support/room/integration/testapp/test/PrimaryKeyTest.java
om/android/support/room/integration/testapp/vo/IntAutoIncPKeyEntity.java
om/android/support/room/integration/testapp/vo/IntegerAutoIncPKeyEntity.java
dc18ce63fe07921b1080e48d3e597e2b5240d17a 21-Feb-2017 Yigit Boyar <yboyar@google.com> Index annotation

This CL adds an Index field to the Entity annotation to create
indices on the table. While Index is good for composite indices,
it might be too verbose for indexing individual fields. For those,
we add a new field to ColumnInfo#index.

When a @Decomposed field has an index, they are dropped but a
warning is printed for each of them.

When a super class has an index, it is dropped but a warning
is printed for each of them. There is also a new inheritSuperIndices
field in the @Entity annotation to inherit these indices.

We also need to change @PrimaryKey to obey these rules. Created
b/35706557 for that.

I've also fixed a bug in Database Impl generation where we were
generating the wrong class for nested classes.

Bug: 35594281
Test: IndexTest.kt, IndexingTest.java, EntityProcessorTest.kt
Change-Id: I9422f4be4e5d59ed7f2f5f98c18bf3966be0496f
om/android/support/room/integration/testapp/test/IndexingTest.java
96cc740203eaa752fc85ca7ca722a8de550ae88c 17-Feb-2017 Yigit Boyar <yboyar@google.com> @Decompose

This CL introduces a new annotation @Decompose which can be used
to merge sub fields of a Pojo into the class that includes it.
This is great for 1-1 relationships or more logical grouping.

This also builds the baseline for Relationships but does not
yet make it very easy (e.g. no easy way to handle join fields
which will have the same name in 2 entities).

This CL also fixes a bug in Pojo processor where it was ignoring
super class's private fields. A ticket is created for it to
properly detect errors w/ inherited fields from super:
b/35568142

Bug: 34258173
Test: PojoProcessorTest.kt, DecompositionTest.java
Change-Id: Idd2617b5fd0ab0ac70750237076158cfc166c53e
om/android/support/room/integration/testapp/TestDatabase.java
om/android/support/room/integration/testapp/dao/PetCoupleDao.java
om/android/support/room/integration/testapp/dao/PetDao.java
om/android/support/room/integration/testapp/dao/SchoolDao.java
om/android/support/room/integration/testapp/dao/UserPetDao.java
om/android/support/room/integration/testapp/test/DecompositionTest.java
om/android/support/room/integration/testapp/test/TestUtil.java
om/android/support/room/integration/testapp/vo/Address.java
om/android/support/room/integration/testapp/vo/Coordinates.java
om/android/support/room/integration/testapp/vo/Pet.java
om/android/support/room/integration/testapp/vo/PetCouple.java
om/android/support/room/integration/testapp/vo/School.java
om/android/support/room/integration/testapp/vo/SchoolRef.java
om/android/support/room/integration/testapp/vo/UserAndPet.java
om/android/support/room/integration/testapp/vo/UserAndPetNonNull.java
74b28faea4bcc4b7fab113a61a066d22dfae7258 15-Feb-2017 Yigit Boyar <yboyar@google.com> @Update annotation

This CL adds support for @Update annotation in @Dao methods.
It has the same semantics as a deletion methods so I've
moved some functionality into shared functions when feasible.

Bug: 32342709
Test: DaoWriter#updateDao, UpdateMethodProcessorTest.kt
Test: SimpleEntityReadWriteTest.java
Change-Id: I86866b82f9114152d3c9eb2fdc4eefa981be1bb0
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
om/android/support/room/integration/testapp/test/TestUtil.java
34e95e59b90e821de3621e5e7e6c5a58dbb5891a 17-Feb-2017 Yigit Boyar <yboyar@google.com> Fix column name in entitiy parsers

This CL fixes a bug in Entitiy Cursor generic reader which was
using field name instead of field's column name.

Bug: 35442740
Test: SimpleEntityReadWriteTest#renamedField
Change-Id: Id2fe4dc74e10cd298f1141b5895bb2ee00ac4b4f
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
om/android/support/room/integration/testapp/test/TestUtil.java
om/android/support/room/integration/testapp/vo/User.java
333b4b5e49c48adf7fb928d445b6f7f276b54a02 15-Feb-2017 Yigit Boyar <yboyar@google.com> Move onConflict strategy to its own class

This moves on conflict strategy to its own class in preparation
for @Upsert and @Update support.

Test: existing tests pass
Bug: 34502968
Change-Id: I34d18a9b19f090b97d4312d9f87f67abe978d1d1
om/android/support/room/integration/testapp/dao/UserDao.java
275e7088223c097c1a2df718455bede42bc9efed 02-Feb-2017 Yigit Boyar <yboyar@google.com> TypeConverters

Tihs CL introduces user defined type converters, which are simple
methods annotated with @TypeConverter.

Each type converter is a custom method that receives 1 parameter
and returns 1 value. The container class for the converter must be
passed into a @TypeConverters annotation to be picked up.
Developer can define these in multiple places depending on the scope
they want to use it.

With this CL, I also migrated @ColumnName annotation into @ColumnInfo
annotation so that we can specify more values. This CL introduces
type affinity field in ColumnInfo. Developers can now specify type
affinity to help the resolution logic to pick the right converter.

Bug: 34610784
Bug: 32342709
Test: CustomConverterProcessorTest.kt, FieldProcessorTest.kt
Test: CustomTypeConverterResolutionTest.kt
Change-Id: I117e4a194e8c93bee58f06a43d688ae04360b08e
om/android/support/room/integration/testapp/TestDatabase.java
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
om/android/support/room/integration/testapp/vo/AvgWeightByAge.java
om/android/support/room/integration/testapp/vo/User.java
13a2048db98b1cc2dbd1692b73b794527975a446 26-Jan-2017 Yigit Boyar <yboyar@google.com> POJO Support

This CL adds ability to return arbitrary POJOs from query results
as long as we match the columns of the result into the pojo.

If the pojo has unused fields or if it ignores some columns from
the result, we show a warning. This warning is listed in
RoomWarnings class and can be disabled via SuppressWarnings.

If SQLVerification is disabled, POJO support does not work.

If the return type is an Entity, we still prefer the entity
converter. This may change in the future.

When converting cursor into POJO, the code is inlined. This
is simpler and avoids the cursor field lookup (because we know
indices ahead of time). This may get expensive if same pojo
is used in multiple places. In the future, we may prefer
creating converters for commonly used pojos.

Bug: 33463891
Test: QueryMethodProcessorTest.kt, PojoTest.java, LiveDataQueryTest.java
Change-Id: Ib82f35d26f839c568e7137c39d4843a9854b20b1
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/LiveDataQueryTest.java
om/android/support/room/integration/testapp/test/PojoTest.java
om/android/support/room/integration/testapp/vo/AvgWeightByAge.java
om/android/support/room/integration/testapp/vo/User.java
b030dcb5b7a62854c0bfe85bf04eaf60caeb83bb 20-Jan-2017 Yigit Boyar <yboyar@google.com> Bind Cursor queries in a type safe API

The rawQuery API in SQLiteDatabase class expects all bind arguments
as Strings. Even though this usually works fine for other types due
to SQLite's type affinity logic, it fails in some cases.

To avoid that, this CL replaces the usage of rawQuery with a new
class called SupportSQLQuery which has a callback to bind items
to a query using the prepared statement.

There is no public API to achieve this so this CL adds a new method
to SupportSQLiteDatabase that accepts SupportSQLiteQuery.
In the framework version, this method is implemented using a
CursorFactory.

This callback is not necessarily instantly invoked so to avoid
the risk of binding to wrong values (because method parameters
may change after the call), the SupportSQLiteStatement is prepared
instantly. For this reason, we have a pooled RoomSQLiteStatement
class that implements the SupportSQLiteProgram API and can rebound
its parameters into another SupportSQLiteProgram. In queries, we
instantly populate it and it can be re-run any later time.
This implementation also avoids creating inner classes for each
query.

Bug: 32342709
Bug: 34503410
Test: RoomSQLiteQueryTest, QueryWriterTest, DaoWriterTest
Change-Id: Id74ba3e02d8de1f7df839249327b3baf933f5f84
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
846dfcf52e22de6d912f8ece05ff939c2c9bd154 17-Jan-2017 Yigit Boyar <yboyar@google.com> LiveDataQuery

This CL adds support for returning LiveData<T> from select queries
in DAO classes.

Rather than extending ResultAdapter to handle this, I've created
a new class called ResultBinder which binds the sql and args with
the ResultAdapter. This would be the place for Rx etc to hook
to implement their observability.

Bug: 32342709
Test: LifeDataQueryTest
Change-Id: I44c7d0571e3d92df5d07fb3802791fc793bf5617
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/InvalidationTest.java
om/android/support/room/integration/testapp/test/LiveDataQueryTest.java
34e5031083f735db3a395b0f6aa430880b072d71 14-Jan-2017 Yigit Boyar <yboyar@google.com> Database invalidation tracking

This CL introduces updated table tracking via sqlite triggers.

There is a new InvalidationTracker class, which creates a version
table in memory that keeps a version for each table. It also
creates triggers for each table and these triggers update the
version table when observed table changes.

When a transaction is committed, we trigger the InvalidationTracker
to refresh itself. This covers all queries that go through Room
but if someone grabs the db and runs a query directly, it wont
work. To support them, there is a public refresh method in the
InvalidationTracker. We may also work around it by wrapping the
SupportSQLiteDatabase.

In a followup CL, I'll introduce an implementataion of
LiveData<T> that observes this table automatically.

Bug: 32342709
Test: InvalidationTrackerTest
Change-Id: I9d0a0cc9dc537200f3fd3cd229df9bfeaf52b56d
om/android/support/room/integration/testapp/test/InvalidationTest.java
07a5d70dc1f53f9948d61853c4ae84df9e11d7a1 05-Jan-2017 Yigit Boyar <yboyar@google.com> Allow update queries in Query methods

This CL adds support for writing UPDATE queryies in @Query
annotations. It uses the same code path w/ delete, nothing
is different except the type detection.

This CL also fixes a bug where we were enforcing a return type
from Delete queries in @Query methods.

Test: SqlParserTest, SimpleEntityReadWriteTest
Change-Id: I6a0f154dcf2c8804915f7d89074abd1f63681676
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
3db6d309415576ef0080c29705dc30496636a986 30-Dec-2016 Yigit Boyar <yboyar@google.com> Add support for Delete queries in @Query annotations

This CL adds support for runinng DELETE queries in
@Query methods.

If the @Query method has predefined number of bind args,
we create a prepared statement and re-use it. If it
has variable number of args, we recreate the query every
time it is run.

Bug: 32342709
Test: SqlParserTest, SimpleEntityReadWriteTest, QueryMethodProcessorTest
Change-Id: I8d9ad83e36e1eed4ddd5e2d714ffb6cdd9881034
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
om/android/support/room/integration/testapp/vo/User.java
958df7dd95c2cecf93cacef6998a4d7e8d39b7ef 28-Dec-2016 Yigit Boyar <yboyar@google.com> @Delete support

This CL adds support for abstract methods in DAO annoated with
@Delete.

It is fairly similar to Insert but there are subtle changes so
they share only limited number of classes. I've decided to name
these methods ShortcutMethods (since they are shortcuts to writing
SQL). Suggestions are welcome.

There will also be support for @Update but the CL is getting big
so i decided to spare it for another CL.

Bug: 32342709
Test: DaoWriterTest, SimpleEntityReadWriteTest
Test: DeletionMethodProcessorTest
Change-Id: Ifbf69067b014f1ae5349567a74b4d3f9efb846c7
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
om/android/support/room/integration/testapp/test/TestUtil.java
059b497bb099c867fb65e62047975ffbc41475f4 16-Dec-2016 Yigit Boyar <yboyar@google.com> Database Builder

This CL moves database creation from constructor to builder pattern.
This avoids ugly constructor override in Database classes and provides
flexibility for future changes in the database construction.

Bug: 32342709
Test: BuilderTest.java
Change-Id: I95de0b47fdd0e32045b8e84c07b997dff6a211c4
om/android/support/room/integration/testapp/TestDatabase.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
b00da61a6f283d47454d64a4ec5e7b14f0aeafe6 15-Dec-2016 Yigit Boyar <yboyar@google.com> Annotate tests with size.

Test: N/A
Bug: 32342385
Bug: 32342709
Change-Id: If08e5367a7f6fc17c591324d8f8dd7a04917cb09
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
5ce90e9725b8c9e8fdcef114694d6984a0ef3141 10-Dec-2016 Yigit Boyar <yboyar@google.com> RoomProcessor and Integration test

This CL puts together the very first working version :').

Bug: 32342709
Test: SimpleEntityReadWriteTest.java, DatabaseWriterTest.kt
Change-Id: I7aa449f92b40aac5b682dccc17d276a4e349115b
om/android/support/room/integration/testapp/TestDatabase.java
om/android/support/room/integration/testapp/dao/UserDao.java
om/android/support/room/integration/testapp/test/SimpleEntityReadWriteTest.java
om/android/support/room/integration/testapp/vo/User.java