EntityManager
class in package klyn.databases.entities

    public class EntityManager:

EntityManager

Gestionnaire des opérations de persistance. Non thread-safe, à créer par thread/requête.

@example ```klyn em = emf.createEntityManager() em.begin() user = User(login="john", password="pwd", firstName="John", lastName="Doe") em.persist(user) em.commit() em.close()

Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | EntityManager `EntityManager(config as DatabaseConfig):` | No summary.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | begin `begin() as Void:` | No summary.
public | close `close() as Boolean:` | No summary.
public | commit `commit() as Void:` | No summary.
public | createNativeQuery `createNativeQuery(sql as String, resultClass as Type) as Query:` | Crée une requête SQL native.
public | createQuery `createQuery(jpql as String) as Query:` | Crée une requête JPQL.
public | find `find(entityClass as Type, id as Object) as Object:` | Trouve une entité par son ID.
public | isOpen `isOpen() as Boolean:` | No summary.
public | merge `merge(entity as Object) as Object:` | Fusionne une entité détachée.
public | persist `persist(entity as Object) as Object:` | Persiste une nouvelle entité.
public | remove `remove(entity as Object) as Void:` | Supprime une entité.
public | rollback `rollback() as Void:` | No summary.