<xml> </xml>

db4o |

# ExtObjectContainer.Bind Method

binds an object to an internal object ID.

void Bind(
object obj,
long id
);

#### Parameters

obj
  the object that is to be bound
id
  the internal id the object is to be bound to

#### Remarks

binds an object to an internal object ID.
This method uses the ID parameter to load the correspondig stored object into memory and replaces this memory reference with the object parameter. The method may be used to replace objects or to reassociate an object with it's stored instance after closing and opening a database file. A subsequent call to set(Object) is necessary to update the stored object.
Requirements:
- The ID needs to be a valid internal object ID, previously retrieved with getID(Object) .
- The object parameter needs to be of the same class as the stored object.

#### See Also

ExtObjectContainer Interface | com.db4o.ext Namespace | com.db4o.ext.ExtObjectContainer.GetID