goog.gears.BaseStore
Classgoog.gears.BaseStore
> goog.Disposable
goog.gears.BaseStore(database)
This class implements the common store functionality
database
{goog.gears.Database
}
goog.gears.BaseStore.SchemaType
EnumSchema definition types … more
.addOnDisposeCallback(callback, opt_scope)
Inherited from goog.Disposable
.
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
callback
{!Function
}
opt_scope
{Object
=}
.createSchema(defs, opt_ifNotExists)
Creates tables and indicies in the target database.
defs
{Array
}
opt_ifNotExists
{boolean
=}
.createTriggers(defs)
Creates triggers specified in definitions. Will first attempt to drop the trigger with this name first.
defs
{Array
}
.creationStack
{string
}Inherited from goog.Disposable
.
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
.dispose()
Inherited from goog.Disposable
.
Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
void
}
.disposeInternal()
[protected]Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' {@code disposeInternal} method. Everywhere else the public {@code dispose} method must be used. For example:
mypackage.MyClass = function() { goog.base(this); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { goog.base(this, 'disposeInternal'); // Dispose logic specific to MyClass. ... };
.dropSchema(defs)
Drops tables and indicies in a target database.
defs
{Array
}
.ensureStoreExists()
Makes sure that tables needed for the store exist and are up to date.
.getCachedData()
[protected]Creates in memory cache of data that is stored in the tables.
.getDisposed
[deprecated]Deprecated. Use {@link #isDisposed} instead.
Inherited from goog.Disposable
.
boolean
}
.getName()
Returns the name of the store.
string
}
.getStoreVersion()
Returns the version number for the specified store
number
}
.hasIndex(name)
Returns true if the index exists in the database
name
{string
}
boolean
}
.hasTable(name)
Returns true if the table exists in the database
name
{string
}
boolean
}
.hasTrigger(name)
name
{string
}
boolean
}
.informOtherStores()
[protected]Informs other stores that this store exists .
.isDisposed()
Inherited from goog.Disposable
.
boolean
}
.loadData()
[protected]Preloads any applicable data into the tables.
.name
[protected] {string
}The name of the store. Subclasses should override and choose their own name. That name is used for the maintaining the version string
.registerDisposable(disposable)
Inherited from goog.Disposable
.
Associates a disposable object with this object so that they will be disposed together.
disposable
{goog.disposable.IDisposable
}
.removeStore()
Removes the tables for the MessageStore
.removeStoreVersion()
Removes the version number for the specified store
.schema
[protected] {Array
.<Object
>}The database schema for the store. This is an array of objects, where each object describes a database object (table, index, trigger). Documentation about the object's fields can be found in the #createSchema documentation. This is in the prototype so that it can be overriden by the subclass. This field is read only.
.updateStore(persistedVersion)
[protected]Updates the tables for the message store in the case where they are out of date.
persistedVersion
{number
}
.version
[protected] {number
}The version number of the database schema. It is used to determine whether the store's portion of the database needs to be updated. Subclassses should override this value.