ManagedRepository
class in package klyn.data.internal

    public final class ManagedRepository<T, TId> implements Repository<T, TId>:

ManagedRepository
All Implemented Interfaces: Repository

Manager-lifetime facade over one provider repository.

Every execution checks the owning manager before delegating, so retaining a repository cannot accidentally keep a closed persistence context usable.

Example

    repository as Repository<User, Int> = manager.repository<User, Int>()

Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | ManagedRepository `ManagedRepository( delegate as Repository<T, TId>, ownerState as EntityManagerState, synchronizer as QuerySynchronizer ):` | Wraps one repository in an EntityManager lifetime check.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | asQuery `asQuery() as Query<T>:` | Returns a lazy identity query checked against the owning manager.
public | count `count() as Long:` | Returns the source entity count while the manager is open.
public | countPlan `countPlan(plan as QueryPlanBase) as Long:` | Counts a canonical plan while the owning manager is open.
public | executePlan `executePlan(plan as QueryPlanBase) as Object:` | Executes a canonical plan while the owning manager is open.
public | existsPlan `existsPlan(plan as QueryPlanBase) as Boolean:` | Tests a canonical plan while the owning manager is open.
public | openStream `openStream(plan as QueryPlanBase) as Object:` | Opens a provider stream while the owning manager is open.
public | providerName `providerName() as String:` | Returns the provider identifier while the owning manager is open.
public | providerText `providerText(plan as QueryPlanBase) as String:` | Returns redacted provider text while the owning manager is open.
public | validateBeforeRead `validateBeforeRead() as Repository<T, TId>:` | Performs strict source validation while the manager is open.

Inherited Methods
method Inherited Methods from Repository: count, validateBeforeRead
method Inherited Methods from Queryable: asQuery
method Inherited Methods from QuerySource: countPlan, executePlan, existsPlan, openStream, providerName, providerText