db4o 6.1

com.db4o.config
Interface ObjectField


public interface ObjectField

configuration interface for fields of classes.

Examples: ../com/db4o/samples/translators.

Use the global Configuration object to configure db4o before opening an ObjectContainer.

Example:
Configuration config = Db4o.configure();
ObjectClass oc = config.objectClass("package.className");
ObjectField of = oc.objectField("fieldName"); of.rename("newFieldName"); of.queryEvaluation(false);


Method Summary
 void cascadeOnActivate(boolean flag)
          sets cascaded activation behaviour.
 void cascadeOnDelete(boolean flag)
          sets cascaded delete behaviour.
 void cascadeOnUpdate(boolean flag)
          sets cascaded update behaviour.
 void indexed(boolean flag)
          turns indexing on or off.
 void queryEvaluation(boolean flag)
          toggles query evaluation.
 void rename(java.lang.String newName)
          renames a field of a stored class.
 

Method Detail

cascadeOnActivate

void cascadeOnActivate(boolean flag)
sets cascaded activation behaviour.

Setting cascadeOnActivate to true will result in the activation of the object attribute stored in this field if the parent object is activated.

The default setting is false.

Parameters:
flag - whether activation is to be cascaded to the member object.
See Also:
Why activation?, ObjectClass.cascadeOnActivate(boolean), ObjectContainer.activate(java.lang.Object, int), Using callbacks

cascadeOnDelete

void cascadeOnDelete(boolean flag)
sets cascaded delete behaviour.

Setting cascadeOnDelete to true will result in the deletion of the object attribute stored in this field on the parent object if the parent object is passed to ObjectContainer#delete().

Caution !
This setting will also trigger deletion of the old member object, on calls to ObjectContainer#set(). An example of the behaviour can be found in ObjectClass#cascadeOnDelete()

The default setting is false.

Parameters:
flag - whether deletes are to be cascaded to the member object.
See Also:
ObjectClass.cascadeOnDelete(boolean), ObjectContainer.delete(java.lang.Object), Using callbacks

cascadeOnUpdate

void cascadeOnUpdate(boolean flag)
sets cascaded update behaviour.

Setting cascadeOnUpdate to true will result in the update of the object attribute stored in this field if the parent object is passed to ObjectContainer#set().

The default setting is false.

Parameters:
flag - whether updates are to be cascaded to the member object.
See Also:
ObjectContainer.set(java.lang.Object), ObjectClass.cascadeOnUpdate(boolean), ObjectClass.updateDepth(int), Using callbacks

indexed

void indexed(boolean flag)
turns indexing on or off.

Field indices dramatically improve query performance but they may considerably reduce storage and update performance.
The best benchmark whether or not an index on a field achieves the desired result is the completed application - with a data load that is typical for it's use.

This configuration setting is only checked when the ObjectContainer is opened. If the setting is set to true and an index does not exist, the index will be created. If the setting is set to false and an index does exist the index will be dropped.

Parameters:
flag - specify true or false to turn indexing on for this field

rename

void rename(java.lang.String newName)
renames a field of a stored class.

Use this method to refactor classes.

Examples: ../com/db4o/samples/rename.

Parameters:
newName - the new fieldname.

queryEvaluation

void queryEvaluation(boolean flag)
toggles query evaluation.

All fields are evaluated by default. Use this method to turn query evaluation of for specific fields.

Parameters:
flag - specify false to ignore this field during query evaluation.

db4o 6.1