org.positronicnet.content

ContentQuery

class ContentQuery [SourceType, IdType] extends AnyRef

Query on an arbitrary content source. See the content package overview for expected usage.

Note that as an implementation cheat, this internally represents query parameters (e.g., limitString) which not all ContentSources will support. We expect to stay safe because the publicly exported subclasses that you get from the content sources won't let users set the fields that the source can't support.

Attributes
abstract
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ContentQuery
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ContentQuery (source: ContentRepository[SourceType, IdType], subSource: SourceType, orderString: String, whereString: String, whereValues: Array[String], limitString: String)

Abstract Value Members

  1. def count : Long

    Returns a count of records matching this query's conditions.

    Returns a count of records matching this query's conditions. May not be supported by all repositories; in particular, it is not supported by ContentProviders.

    Attributes
    abstract
  2. def facility : AppFacility

    Attributes
    abstract
  3. def limit (s: String): ContentQuery[SourceType, IdType]

    Returns a new query whose results will be limited to the given number of rows.

    Returns a new query whose results will be limited to the given number of rows. May not be supported by all repositories; in particular, it is not supported by ContentProviders.

    Attributes
    abstract
  4. def order (s: String): ContentQuery[SourceType, IdType]

    Returns a new ContentQuery, equivalent to this one, except that results will be ordered as per the given String.

    Returns a new ContentQuery, equivalent to this one, except that results will be ordered as per the given String. Interpretation of the Strings is as per the underlying APIs, e.g., as for a SQL order by when querying a database.

    Attributes
    abstract
  5. def where (s: String, vals: ContentValue*): ContentQuery[SourceType, IdType]

    Returns a new ContentQuery with the same semantics as this one, except that it adds extra conditions.

    Returns a new ContentQuery with the same semantics as this one, except that it adds extra conditions. If the condition contains '?' placeholders, they will be replaced with ContentValue arguments, e.g.

        qry = otherQuery.where( "created_at > ? and status = ?",
                                myDate.getTime, "in_progress" )
    
    Attributes
    abstract
  6. def whereEq (pairs: (String, ContentValue)*): ContentQuery[SourceType, IdType]

    Returns a new ContentQuery with the same semantics as this one, except that it adds the condition that each of the fields named by the Strings in the arguments should be equal to the associated ContentValue.

    Returns a new ContentQuery with the same semantics as this one, except that it adds the condition that each of the fields named by the Strings in the arguments should be equal to the associated ContentValue. E.g.,

        qry = otherQuery.where( "status" -> "in_progress",
                                "urgency_level" -> 3 )
    

    using the same shorthand for pairs as is commonly used for Map constructors.

    Attributes
    abstract

Concrete Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def buildContentValues (assigns: (String, ContentValue)*): ContentValues

    Attributes
    protected
  8. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. def conditionKey : (String, Seq[String])

    All conditions on this ContentQuery.

    All conditions on this ContentQuery. Useful to determine when two are equivalent.

  10. def delete : Int

    Delete all records which match this ContentQuery

  11. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  12. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  15. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  16. def insert (assigns: (String, ContentValue)*): IdType

    Inserts a new record, with values of the columns named by the Strings to each associated ContentValue.

    Inserts a new record, with values of the columns named by the Strings to each associated ContentValue. E.g.,

        qry.insert( "description" -> "write documentation",
                    "status" -> "in_progress",
                    "urgency_level" -> 3 )
    

    using the same shorthand for pairs as is commonly used for Map constructors.

  17. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  18. def limit (l: Int): ContentQuery[SourceType, IdType]

    Returns a new query whose results will be limited to the given number of rows.

    Returns a new query whose results will be limited to the given number of rows. May not be supported by all repositories; in particular, it is not supported by ContentProviders.

  19. def log (stmtType: String, contentValues: ContentValues = null, cols: Array[String] = null): AnyVal

    Attributes
    protected
  20. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  21. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  22. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  23. def select (cols: String*): PositronicCursor

    Return a PositronicCursor for the values of the given columns, in records matching this query, respecting its order and limit.

    Return a PositronicCursor for the values of the given columns, in records matching this query, respecting its order and limit.

    (This is a wrapper around standard Android Cursors, which provides a few extra features; its wrappedCursorAs method can be used to get the underlying raw Cursor, if you want it.)

  24. def selectDefaultColumns : PositronicCursor

    Return a PositronicCursor for the values of the underlying resource's default set of columns, in records matching this query, respecting its order and limit.

    Return a PositronicCursor for the values of the underlying resource's default set of columns, in records matching this query, respecting its order and limit.

    (This is a wrapper around standard Android Cursors, which provides a few extra features; its wrappedCursorAs method can be used to get the underlying raw Cursor, if you want it.)

  25. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  26. def toString (): String

    Definition Classes
    ContentQuery → AnyRef → Any
  27. def update (assigns: (String, ContentValue)*): Int

    Updates each record matched by the query, setting values of the columns named by the Strings to each associated ContentValue.

    Updates each record matched by the query, setting values of the columns named by the Strings to each associated ContentValue. E.g.,

        qry.update( "status" -> "in_progress",
                    "urgency_level" -> 3 )
    

    using the same shorthand for pairs as is commonly used for Map constructors.

  28. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  29. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  30. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. def withUpdatedWhere [T] (pairs: Seq[(String, ContentValue)])(handler: (String, Array[String]) ⇒ T): T

    Attributes
    protected
  32. def withUpdatedWhere [T] (s: String, arr: Array[ContentValue])(handler: (String, Array[String]) ⇒ T): T

    Attributes
    protected

Inherited from AnyRef

Inherited from Any