SchemaManager
class in package klyn.data

    public final class SchemaManager:

SchemaManager

Thread-safe facade for physical schema creation, inspection and validation.

A SchemaManager belongs to an EntityManagerFactory and uses the immutable entity-model snapshot captured when that factory is created. It never shares an EntityManager identity map or transaction.

    try factory = EntityManagerFactory(configuration):
    schema = factory.schema
    if not schema.exists(User.type):
    schema.create(User.type)
    schema.validate()

Properties

Modifier and Type | Member | Description
--- | --- | ---
public readonly property | mappedTypes `mappedTypes as IList<Type>:` | Complete mapped entity types captured by the owning factory.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | apply `apply(plan as SchemaPlan) as Void:` | Applies a plan produced for the current immutable factory model.
public | create `create() as Void:` | Creates every missing structure required by the factory entity model.
public | create `create(entityType as Type) as Void:` | Creates the missing structure for one mapped entity.
public | diff `diff() as SchemaPlan:` | Computes an immutable reconciliation plan for every mapped entity.
public | diff `diff(entityType as Type) as SchemaPlan:` | Computes an immutable reconciliation plan for one mapped entity.
public | drop `drop() as Void:` | Drops all physical structures represented by this factory, in provider dependency order.
public | drop `drop(entityType as Type) as Void:` | Drops the physical structure represented by one mapped entity.
public | exists `exists() as Boolean:` | Tests whether every mapped entity has a physical provider structure.
public | exists `exists(entityType as Type) as Boolean:` | Tests whether one mapped entity has a physical provider structure.
public | validate `validate() as Void:` | Validates all mapped physical structures without changing them.
public | validate `validate(entityType as Type) as Void:` | Validates one mapped physical structure without changing it.