db4o

ObjectContainer.set Method 

newly stores objects or updates stored objects.

[Visual Basic]
Sub set( _ 
   ByVal obj As Object _ 
)
[C#]
void set(
   object obj
);
[C++]
void set(
   Object* obj
);
[JScript]
function set(
   Object obj
);

Parameters

obj
the object to be stored or updated.

Remarks

newly stores objects or updates stored objects.

An object not yet stored in the

ObjectContainer
will be stored when it is passed to
set()
. An object already stored in the
ObjectContainer
will be updated.

Updates
- will affect all simple type object members.
- links to object members that are already stored will be updated.
- new object members will be newly stored. The algorithm traverses down new members, as long as further new members are found.
- object members that are already stored will not be updated themselves.
Every object member needs to be updated individually with a call to
set()
unless a deep global or class-specific update depth was configured or cascaded updates were defined in the class or in one of the member fields .

Examples: ../com/db4o/samples/update.

Depending if the passed object is newly stored or updated, the callback method objectOnNew or objectOnUpdate is triggered. objectOnUpdate might also be used for cascaded updates.

See Also

ObjectContainer Interface | com.db4o Namespace | ExtObjectContainer#set(object, depth) | com.db4o.config.Configuration.updateDepth | com.db4o.config.ObjectClass.updateDepth | com.db4o.config.ObjectClass.cascadeOnUpdate | com.db4o.config.ObjectField.cascadeOnUpdate | Using callbacks