Generic interface to "content repositories", including databases
and ContentResolvers. Each repository can host multiple "sources"
(tables in a database, ContentProviders for the content resolver,
etc.). Ordinarily these methods aren't invoked directly, but instead
by means of a ContentQuery object, which
provides a shorthand fluid interface to adding conditions, etc.
This trait, and the associated ContentQuery
class, are intended as a shorthand, along the lines of the Positronic Net
ui shorthand, which allows easier use of the APIs,
with less boilerplate code, but without changing any of the underlying
semantics much.
The type parameters are the type of the handle to the underlying Android
objects (e.g., a SQLiteDatabase) and the type of the row IDs returned
by insert. (Note that most of the
ContentRepository calls allow the
specification of a String where argument which can name a source with
more specificity, e.g., a table within a database.)
For use with the ORM, the latter must be Long; thus, for
instance, the ORM can handle a
LongIdContentResolverRepository (which
assumes that the URIs returned by the underlying ContentResolver encode
an ID according to the usual assumptions), but not a
UriIdContentResolverRepository (which
assumes nothing). See
org.positronicnet.content.PositronicContentResolver for more.
Generic interface to "content repositories", including databases and ContentResolvers. Each repository can host multiple "sources" (tables in a database, ContentProviders for the content resolver, etc.). Ordinarily these methods aren't invoked directly, but instead by means of a ContentQuery object, which provides a shorthand fluid interface to adding conditions, etc.
This trait, and the associated ContentQuery class, are intended as a shorthand, along the lines of the Positronic Net ui shorthand, which allows easier use of the APIs, with less boilerplate code, but without changing any of the underlying semantics much.
The type parameters are the type of the handle to the underlying Android objects (e.g., a
SQLiteDatabase
) and the type of the row IDs returned byinsert
. (Note that most of the ContentRepository calls allow the specification of a Stringwhere
argument which can name a source with more specificity, e.g., a table within a database.)For use with the ORM, the latter must be
Long
; thus, for instance, the ORM can handle a LongIdContentResolverRepository (which assumes that the URIs returned by the underlying ContentResolver encode an ID according to the usual assumptions), but not a UriIdContentResolverRepository (which assumes nothing). See org.positronicnet.content.PositronicContentResolver for more.