ObjectClass/IObjectClass provides an interface for class configuration.
Java:
ObjectClass oc =
Db4o.configure().objectClass(clazz);
clazz parameter here can be one of the following:
Java:
public void
callConstructor(boolean flag);
advises db4o to try instantiating objects of this class with/without calling constructors. For more information see Object Construction.
Java:
public void
cascadeOnActivate(boolean flag);
sets cascaded activation behavior for this class. For more information see Activation.
Java:
public void
cascadeOnDelete(boolean flag);
sets cascaded delete behavior for this class. For more information see Delete Behavior.
Java:
public void
cascadeOnUpdate(boolean flag);
sets cascaded update behavior for this class. For more information see Update Depth.
Java:
public void
compare(ObjectAttribute 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. For more information see Custom Query Comparator.
Java:
public void
enableReplication(boolean 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. For more information see db4o Replication System (dRS)
Java:
public void
generateUUIDs(boolean setting);
generate UUIDs for stored objects of this class. For more information see Unique Universal IDs.
Java:
public void
generateVersionNumbers(boolean setting);
generate version numbers for stored objects of this class. For more information see db4o Replication System (dRS)
Java:
public void indexed(boolean
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:
For more information see No Class Index.
Java:
public void
maximumActivationDepth (int depth);
sets the maximum activation depth for this class to the desired value. For more information see Activation.
Java:
public void
minimumActivationDepth (int depth);
sets the minimum activation depth to the desired value. For more information see Activation.
Java:
public ObjectField objectField
(String fieldName);
returns an ObjectField object to configure the specified field. For more information see ObjectField Configuration.
Java:
public void
persistStaticFieldValues();
turns on storing static field values for this class. For more information see Static Fields And Enums.
Java:
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.
This method is deprecated, use Aliases instead.
Java:
public void rename (String
newName);
renames a stored class. For more information see Refactoring and Schema Evolution.
Java:
public void
storeTransientFields (boolean flag);
allows to specify if transient fields
are to be stored. The default for every class is false
.
For more information see Storing Transient Fields.
Java:
public void translate
(ObjectTranslator translator);
registers a translator for this class. For more information see Translators.
Java:
public void updateDepth (int
depth);
specifies the updateDepth for this class. For more information see Update Depth.