klyn.data.EntityManager.merge
method

    public merge<T>(entity as T) as T:

Description

Copies detached state into a managed instance.

Unlike `persist`, merge never makes the supplied detached instance managed. Callers must continue with the returned instance.

Parameters

Parameter | Description
--- | ---
`<T>` | Entity type.
`entity` | Detached or already managed entity.

Returns

Managed instance containing the merged state.

Throws

- EntityNotFoundException when a generated detached identity no longer exists.

Example

    managed = manager.merge(detachedUser)