History log of /frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bdc4c86d3dff74f6634a38e2f7b316b0e823a2c8 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
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.java
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
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.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
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.java
1d3d9d6121d53a4c11223ba475d8954315952a09 15-Jun-2017 Yigit Boyar <yboyar@google.com> Fix addition code for argument size

This CL fixes a problem in the query writer where, while
summing the argument list counts, we would not specify a
separator which defaults to ','. Now we specify empty
string to avoid adding unwanted characters.

Bug: 62608681
Test: DaoWriterTest
Change-Id: If7a9fac6fa0e61d0730845691eb23579ebd30ba1
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.java
17caba59e1fd850fe1381d7311d23afc4e07cdfb 05-Jun-2017 Yuichi Araki <yaraki@google.com> Allow Dao to have constructor with DB param

This change allows abstract Dao class to have a constructor with a
RoomDatabase parameter. The implementation Dao class will call it with
the approppriate database instance.

Bug: 38488747
Test: DaoWriterTest, DatabaseProcessorTest
Change-Id: I6d7fa98b19a99b7a171983422c882557bde306bc
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.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
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.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
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.java
88865f77c35657a2bc545a718ca16a648fc8b62e 24-Jan-2017 Yigit Boyar <yboyar@google.com> Database Verification

This CL adds logic to verify @Query sql's at compile time.
This is done by creating an in-memory version of the database
during compile time and preparing queries against it.

This is an optional process that developers can disable via
SkipQueryVerification since there is always a chance that we
won't be able to find the sqlite on the host machine. To minimize
the risk, we are shipping xerial with the compiler.
SkipQueryVerification might be necessary if the developer modifies
the database directly.

Right now, we don't use this information besides making sure
query compiles. In followup CLs, we'll use this information
to validate return types and also allow arbitrary java classes
as return types (fi their fields match the fields in the response).

Bug: 33463891
Test: DatabaseVerifierTest
Change-Id: I9667a3bba15a54f25bbe7795de02eaeb435900f9
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.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
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.java
efaf86afac3163868eda7f91a1c04e3f6e6d7520 03-Dec-2016 Yigit Boyar <yboyar@google.com> Query result adapters

This CL introduces the mecnism to generate the code for a @Query.

I've also introduced a db package which abstracts all communication
with the SqliteDatabase. This will grow to allow people to swap
the underlying sqlite implementation.

Bug: 32342709
Bug: 30355996
Test: DaoWriterTest.kt, EntityCursorConverterWriterTest.kt
Change-Id: I4962ebd3f095839adf00e36ddd1588df7b4ac9c1
/frameworks/support/room/compiler/src/test/data/daoWriter/input/ComplexDao.java