public final class EntityManagerFactory implements AutoClosable
Thread-safe factory for short-lived EntityManager instances.
The factory owns immutable provider configuration and mapping metadata. It performs no connection I/O until a manager actually executes provider work.
try factory = EntityManagerFactory(configuration, entities=[User]):
try manager = factory.createEntityManager():
users = manager.repository<User, Int>()| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | mappedTypes | Complete immutable entity model captured when this factory was acquired. |
| public readonly property | openopen as Boolean |
Indicates whether new managers can still be created. |
| public readonly property | schemaschema as SchemaManager |
Thread-safe schema manager bound to this factory's immutable entity model. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | EntityManagerFactoryEntityManagerFactory(
configuration as ProviderConfiguration,
entities as IList<Type>,
mappings as MappingRegistry = MappingRegistry.empty,
policies as IList<EntityPolicyRegistration> = [],
policyContext as PolicyContext = PolicyContext.empty
) |
Creates a factory over immutable provider and mapping configuration. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | closeclose() as Void |
Rejects future manager creation. |
| public | createEntityManagercreateEntityManager() as EntityManager |
Creates one independent, non-thread-safe persistence context. |