public final class ManagedRepository<T, TId> implements Repository<T, TId>:
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.
repository as Repository<User, Int> = manager.repository<User, Int>()
| Modifier and Type | Member | Description |
|---|---|---|
| public | ManagedRepositoryManagedRepository(
delegate as Repository<T, TId>,
ownerState as EntityManagerState,
synchronizer as QuerySynchronizer
): |
Wraps one repository in an EntityManager lifetime check. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | asQueryasQuery() as Query<T>: |
Returns a lazy identity query checked against the owning manager. |
| public | countcount() as Long: |
Returns the source entity count while the manager is open. |
| public | countPlancountPlan(plan as QueryPlanBase) as Long: |
Counts a canonical plan while the owning manager is open. |
| public | executePlanexecutePlan(plan as QueryPlanBase) as Object: |
Executes a canonical plan while the owning manager is open. |
| public | existsPlanexistsPlan(plan as QueryPlanBase) as Boolean: |
Tests a canonical plan while the owning manager is open. |
| public | openStreamopenStream(plan as QueryPlanBase) as Object: |
Opens a provider stream while the owning manager is open. |
| public | providerNameproviderName() as String: |
Returns the provider identifier while the owning manager is open. |
| public | providerTextproviderText(plan as QueryPlanBase) as String: |
Returns redacted provider text while the owning manager is open. |
| public | validateBeforeReadvalidateBeforeRead() as Repository<T, TId>: |
Performs strict source validation while the manager is open. |