klyn.data.EntityManager.persist
method
public persist<T>(entity as T) as Void:
Description

Registers a new entity for insertion.

The entity becomes managed immediately, but SQL is emitted only by saveChanges(), an automatic flush, or transaction commit.

Parameters
ParameterDescription
<T>Entity type.
entityNew entity instance.
Throws
  • EntityExistsException when a generated identity is already set or another instance with the same identity is managed.
  • ProviderCapabilityException for read-only providers.
Example
manager.persist(User(login="alice"))