Class SessionImpl

java.lang.Object
io.jmix.core.metamodel.model.impl.SessionImpl
All Implemented Interfaces:
Session, SessionImplementation

public class SessionImpl extends Object implements SessionImplementation
  • Constructor Details

    • SessionImpl

      public SessionImpl()
  • Method Details

    • findClass

      public @Nullable MetaClass findClass(String name)
      Description copied from interface: Session
      Search MetaClass by its name in the whole metamodel.
      Specified by:
      findClass in interface Session
      Parameters:
      name - entity name
      Returns:
      MetaClass instance or null if not found
    • getClass

      public MetaClass getClass(String name)
      Description copied from interface: Session
      Search MetaClass by its name in the whole metamodel.
      Specified by:
      getClass in interface Session
      Parameters:
      name - entity name
      Returns:
      MetaClass instance. Throws exception if not found.
    • findClass

      public @Nullable MetaClass findClass(Class<?> javaClass)
      Description copied from interface: Session
      Search MetaClass by the corresponding Java class in the whole metamodel.
      Specified by:
      findClass in interface Session
      Parameters:
      javaClass - Java class defining the entity
      Returns:
      MetaClass instance or null if not found
    • getClass

      public MetaClass getClass(Class<?> javaClass)
      Description copied from interface: Session
      Search MetaClass by the corresponding Java class in the whole metamodel.
      Specified by:
      getClass in interface Session
      Parameters:
      javaClass - Java class defining the entity
      Returns:
      MetaClass instance. Throws exception if not found.
    • getClasses

      public Collection<MetaClass> getClasses()
      Specified by:
      getClasses in interface Session
      Returns:
      collection of all MetaClasses in the whole metamodel
    • registerClass

      public void registerClass(MetaClass metaClass)
      Specified by:
      registerClass in interface SessionImplementation
    • registerClass

      public void registerClass(String name, Class javaClass, MetaClass metaClass)
      Specified by:
      registerClass in interface SessionImplementation
    • unregisterClass

      public void unregisterClass(MetaClass metaClass)
      Specified by:
      unregisterClass in interface SessionImplementation
    • getClassByNameSnapshot

      public Map<String,MetaClass> getClassByNameSnapshot()
      Returns a copy of meta classes indexed by entity name.

      Intended for metadata snapshot cloning.

    • getClassByClassSnapshot

      public Map<Class,MetaClass> getClassByClassSnapshot()
      Returns a copy of meta classes indexed by Java type.

      Intended for metadata snapshot cloning.

    • replaceMappings

      public void replaceMappings(Map<String,MetaClass> classByName, Map<Class,MetaClass> classByClass)
      Replaces internal meta-class indexes with the provided mappings.

      Intended for publishing a fully rebuilt session snapshot.

      Parameters:
      classByName - meta classes indexed by entity name
      classByClass - meta classes indexed by Java type