Class MetadataImpl

java.lang.Object
io.jmix.core.impl.MetadataImpl
All Implemented Interfaces:
Metadata, Session

@Component("core_Metadata") public class MetadataImpl extends Object implements Metadata
  • Field Details

    • session

      protected volatile Session session
    • resources

      @Autowired protected Resources resources
    • entityInitializers

      @Lazy @Autowired(required=false) protected List<EntityInitializer> entityInitializers
  • Constructor Details

    • MetadataImpl

      @Autowired public MetadataImpl(MetadataLoader metadataLoader)
  • Method Details

    • getSession

      public Session getSession()
      Description copied from interface: Metadata
      Get Metadata session - interface providing access to MetaClasses and MetaProperties.
      Specified by:
      getSession in interface Metadata
      Returns:
      current metadata session
    • getClass

      public MetaClass getClass(Object entity)
      Description copied from interface: Metadata
      Returns MetaClass of the given entity.
      Specified by:
      getClass in interface Metadata
      Parameters:
      entity - entity instance
      Returns:
      MetaClass instance
    • internalCreate

      protected <T> T internalCreate(Class<T> entityClass)
    • internalCreate

      protected <T> T internalCreate(Class<T> entityClass, @Nullable Object id)
    • create

      public <T> T create(Class<T> entityClass)
      Description copied from interface: Metadata
      Instantiate an entity, taking into account extended entities.
      Specified by:
      create in interface Metadata
      Parameters:
      entityClass - entity class
      Returns:
      entity instance
    • create

      public <T> T create(Class<T> entityClass, Object id)
      Description copied from interface: Metadata
      Instantiate an entity with provided id, taking into account extended entities.
      Specified by:
      create in interface Metadata
      Parameters:
      entityClass - entity class
      id - entity id
      Returns:
      entity instance
    • create

      public Object create(MetaClass metaClass)
      Description copied from interface: Metadata
      Instantiate an entity, taking into account extended entities.
      Specified by:
      create in interface Metadata
      Parameters:
      metaClass - entity MetaClass
      Returns:
      entity instance
    • create

      public Object create(MetaClass metaClass, Object id)
      Description copied from interface: Metadata
      Instantiate an entity with provided id, taking into account extended entities.
      Specified by:
      create in interface Metadata
      Parameters:
      metaClass - entity MetaClass
      id - entity id
      Returns:
      entity instance
    • create

      public Object create(String entityName)
      Description copied from interface: Metadata
      Instantiate an entity, taking into account extended entities.
      Specified by:
      create in interface Metadata
      Parameters:
      entityName - entity name
      Returns:
      entity instance
    • create

      public Object create(String entityName, Object id)
      Description copied from interface: Metadata
      Instantiate an entity with provided id, taking into account extended entities.
      Specified by:
      create in interface Metadata
      Parameters:
      entityName - entity name
      id - entity id
      Returns:
      entity instance
    • findClass

      @Nullable public 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

      @Nullable public 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