ObjectClass/IObjectClass provides an interface for class configuration.
.NET:
IObjectClass oc =
Db4oFactory.Configure().ObjectClass(clazz);
clazz parameter here can be one of the following:
.NET:
public void
CallConstructor(bool flag);
advises db4o to try instantiating objects of this class with/without calling constructors. For more information see Object Construction.
.NET:
public void
CascadeOnActivate(bool flag);
sets cascaded activation behavior for this class. For more information see Activation.
.NET:
public void
CascadeOnDelete(bool flag);
sets cascaded delete behavior for this class. For more information see Delete Behavior.
.NET:
public void
CascadeOnUpdate(bool flag);
sets cascaded update behavior for this class. For more information see Update Depth.
.NET:
public void
Compare(IObjectAttribute attributeProvider);
registers an attribute provider for special query behavior.
The query processor will compare the object returned by the attribute provider instead of the actual object, both for the constraint and the candidate persistent object.
.NET:
public void
EnableReplication(bool setting);
enable replication of the specified class. Must be called before databases are created or opened so that db4o will control versions and generate UUIDs for objects of this class, which is required for using replication.
.NET:
public void GenerateUUIDs(bool
setting);
generate UUIDs for stored objects of this class. For more information see Unique Universal IDs.
.NET:
public void GenerateVersionNumbers(bool
setting);
generate version numbers for stored objects of this class.
.NET:
public void Indexed(bool
flag);
turns the class index on or off.
db4o maintains an index for each class to be able to deliver all instances of a class in a query. If the class index is never needed, it can be turned off with this method to improve the performance on creation and deletion of the class objects.
Common cases where a class index is not needed:
.NET:
public void
MarshallWith(IObjectMarshaller marshaller);
registers a custom marshaller for this class. For more information see Marshallers.
.NET:
public void
MaximumActivationDepth (int depth);
sets the maximum activation depth for this class to the desired value. For more information see Activation.
.NET:
public void
MinimumActivationDepth (int depth);
sets the minimum activation depth to the desired value. For more information see Activation.
.NET:
public IObjectField OjectField
(string fieldName);
returns an ObjectField object to configure the specified field. For more information see ObjectField Configuration.
.NET:
public void
PersistStaticFieldValues();
turns on storing static field values for this class. For more information see Static Fields And Enums.
.NET:
public void ReadAs(object
clazz);
creates a temporary mapping of a persistent class to a different class.
If the meta-information for this ObjectClass has been stored to the database file, it will be read from the database file as if it was representing the class specified by the clazz parameter passed to this method.
The clazz parameter can be any of the following:
This method will be ignored if the database file already contains meta-information for clazz.
.NET:
public void Rename (string
newName);
renames a stored class. For more information see Refactoring and Schema Evolution.
.NET:
public void
StoreTransientFields (bool flag);
allows to specify if transient fields
are to be stored. The default for every class is false
.
.NET:
public void Translate
(IObjectTranslator translator);
registers a translator for this class. For more information see Translators.
.NET:
public void UpdateDepth (int
depth);
specifies the updateDepth for this class. For more information see Update Depth.