IObjectClass.

CascadeOnDelete(bool) Method

Summary

sets cascaded delete behaviour.
Assembly
Db4objects.Db4o-2010.dll
Namespace
Db4objects.Db4o.Config
Containing Type
IObjectClass

Syntax

void CascadeOnDelete(bool flag)

Remarks

sets cascaded delete behaviour.

Setting CascadeOnDelete to true will result in the deletion of all member objects of instances of this class, if they are passed to Db4objects.Db4o.IObjectContainer.Delete(System.Object) .

Caution !
This setting will also trigger deletion of old member objects, on calls to Db4objects.Db4o.IObjectContainer.Store(System.Object) .

An example of the behaviour:
ObjectContainer con;
Bar bar1 = new Bar();
Bar bar2 = new Bar();
foo.bar = bar1;
con.Store(foo); // bar1 is stored as a member of foo
foo.bar = bar2;
con.Store(foo); // bar2 is stored as a member of foo

The last statement will also delete bar1 from the ObjectContainer, no matter how many other stored objects hold references to bar1.

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

Name Type Description
flag bool whether deletes are to be cascaded to member objects.

Return Value

Type Description
void

See Also

  • Db4objects.Db4o.Config.IObjectField.CascadeOnDelete(System.Boolean)
  • Db4objects.Db4o.IObjectContainer.Delete(System.Object)
  • Db4objects.Db4o.Ext.IObjectCallbacks