ObjectStore Object
An object store is represented
by the ObjectStore class in the Content Engine API. You
can use static methods on the Factory inner classes
to create instances of ObjectStore. Use createInstance to
create a new instance of an ObjectStore object. There
is an overloaded version of createInstance for specifying
a customized schema script, which allows you to get finer grained
control of storage locations for object store tables, indexes, and LOB
columns than you can get by using the ObjectStore object's
default database storage locations.
When
a new instance of an ObjectStore object is created
with createInstance, the ObjectStore object
does not exist in the Global Configuration Database (GCD) until a
round trip to the server happens at a later commit (save) step. The
save step can be an explicit call to the save method,
or it can be started in a batch operation.
Use getInstance or fetchInstance to
retrieve an existing instance of an ObjectStore object. The
difference between these two methods is that getInstance does
not verify the existence of the requested object on the server; it
returns a local reference to the object, which is not affiliated with a
server object until you perform a function on the object (for example,
fetch a property value) that causes a round trip to the server. This
technique, also called "fetchless instantiation", is useful when the wanted
object serves only passively, for example, as the target value of
an object-valued property. The fetchInstance method,
however, immediately makes a round trip to the server to retrieve
the property values of the ObjectStore object.
In
addition to using Factory methods to instantiate an ObjectStore object,
you can get a reference to an ObjectStore object
from other objects. You can retrieve a ObjectStoreSet collection
from Domain and iterate the collection. You can get
a ObjectStore object from an instance of a RepositoryObject subclass.
In
most cases when you are using Factory methods such as createInstance and fetchInstance to
create or retrieve instances of known object types in an object store,
you must specify the object store as a parameter to the method. Calling
the save method on the returned object saves it in
the specified object store. If you don't have prior knowledge of the
object type, you can use the methods on the InstantiatingScope interface to
create or retrieve objects.