Package com.db4o.config
Interface ObjectField
-
- All Known Implementing Classes:
Config4Field
public interface ObjectField
configuration interface for fields of classes.
UseObjectClass.objectField(String)
to access this setting.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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
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.
In client-server environment this setting should be used on both client and server.
This setting can be applied to an open object container.- 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 toObjectContainer.delete(java.lang.Object)
.
Caution !
This setting will also trigger deletion of the old member object, on calls toObjectContainer.store(Object)
. An example of the behaviour can be found inObjectClass.cascadeOnDelete(boolean)
The default setting is false.
In client-server environment this setting should be used on both client and server.
This setting can be applied to an open object container.- 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 toObjectContainer.store(Object)
.
The default setting is false.
In client-server environment this setting should be used on both client and server.
This setting can be applied to an open object container.- Parameters:
flag
- whether updates are to be cascaded to the member object.- See Also:
ObjectContainer.store(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 theObjectContainer
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.
In client-server environment this setting should be used on both client and server.
If this setting is applied to an open ObjectContainer it will take an effect on the next time ObjectContainer is opened.- 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.
In client-server environment this setting should be used on both client and server.
This setting can NOT be applied to an open object container.- Parameters:
newName
- the new field name.
-
-