org.positronicnet.db

ThreadlessDatabase

class ThreadlessDatabase extends AppFacility

Primitive base for database singletons. For most purposes, you'll want to use Database instead, for its extra convenience features. ThreadlessDatabase is available for cases where the conveniences are getting in the way.

Manages setup and schema upgrades, and makes the tables database available as Positronic Net ContentRepositorys which can be queried directly, or manipulated via the orm. Further comments on how this works for Database also apply here.

Note that opening a Database does not trigger any I/O; that action is delayed until the first query (at which point we also perform any schema updates, etc.). It is strongly recommended that this not be done on an Activity main UI thread.

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

Instance Constructors

  1. new ThreadlessDatabase (filename: String, logTag: String)

Abstract Value Members

  1. def schemaUpdates : List[String]

    List of "one-way migrations" that define the current DB schema.

    List of "one-way migrations" that define the current DB schema... See the Database overview.

    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 apply (table: String): DbQuery

    Returns a ContentQuery referring to all rows in one of the tables of this database, which may be used directly, or used to seed a RecordManager for the ORM.

  7. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  8. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. def close : Unit

    Close the facility.

    Close the facility.

    First, decrements the "nested open" count. If it has reached zero, do a "real" close, using the protected realclose method. Otherwise, some other activity is still using the facility, and it stays open.

    When the last activity or service calls close, the facility actually does shut down, using the protected realClose method, which will shut down threads, close files, or whatever.

    Definition Classes
    AppFacility
  10. def eq (arg0: AnyRef): Boolean

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  14. def getLogTag : String

    Tag for the facility to use in log entries

    Tag for the facility to use in log entries

    Definition Classes
    AppFacility
  15. def getReadableDatabase : SQLiteDatabase

    Get a readable Android SQLiteDatabase object, for direct invocation of core APIs.

  16. def getWritableDatabase : SQLiteDatabase

    Get a writable Android SQLiteDatabase object, for direct invocation of core APIs.

  17. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  18. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  19. def log (s: String): AnyVal

    Writes a debugging log method, using the facility's logTag

    Writes a debugging log method, using the facility's logTag

    Definition Classes
    AppFacility
  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 onCreate (db: SQLiteDatabase): Unit

    Invoked when the database is created.

    Invoked when the database is created. Default behavior is to run through the complete list of schemaUpdates.

  24. def onUpgrade (db: SQLiteDatabase, oldVersion: Int, newVersion: Int): Unit

    Invoked when the database is created.

    Invoked when the database is created. Default behavior is to run through the sublist of schemaUpdates from the prior version to the end (which defines the current version).

  25. def openInContext (ctx: Context): Unit

    Open the facility.

    Open the facility.

    If the facility isn't already open, does setup which depends on the particular facility (which may involve opening files, starting threads, or whatever) --- a "real" open, using the protected realOpen method. The given Context may be used for setup, depending on the nature of the facility.

    If it is already open, just increments a "nested open" count; see close below.

    Definition Classes
    AppFacility
  26. def realClose : Unit

    Attributes
    protected
    Definition Classes
    ThreadlessDatabaseAppFacility
  27. def realOpen (ctx: Context): Unit

    Attributes
    protected
    Definition Classes
    ThreadlessDatabaseAppFacility
  28. def synchronized [T0] (arg0: ⇒ T0): T0

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

    Definition Classes
    AnyRef → Any
  30. def version : Int

    Schema version.

    Schema version. By default, the length of the schemaUpdates list.

  31. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AppFacility

Inherited from AnyRef

Inherited from Any