@Component(value="cuba_Metadata") public class MetadataImpl extends java.lang.Object implements Metadata
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
protected GlobalConfig |
config |
protected DatatypeRegistry |
datatypeRegistry |
protected ExtendedEntities |
extendedEntities |
protected NumberIdSource |
numberIdSource |
protected com.google.common.cache.LoadingCache<java.lang.Class<?>,java.util.List<java.lang.reflect.Method>> |
postConstructMethodsCache |
protected Resources |
resources |
protected java.util.List<java.lang.String> |
rootPackages |
protected Session |
session |
protected MetadataTools |
tools |
protected ViewRepository |
viewRepository |
Constructor and Description |
---|
MetadataImpl() |
Modifier and Type | Method and Description |
---|---|
protected <T extends Entity> |
__create(java.lang.Class<T> entityClass) |
protected void |
assignIdentifier(Entity entity) |
protected void |
assignUuid(Entity entity) |
<T extends Entity> |
create(java.lang.Class<T> entityClass)
Instantiate an entity, taking into account extended entities.
|
Entity |
create(MetaClass metaClass)
Instantiate an entity, taking into account extended entities.
|
Entity |
create(java.lang.String entityName)
Instantiate an entity, taking into account extended entities.
|
protected void |
createEmbedded(Entity entity) |
MetaClass |
getClass(java.lang.Class<?> clazz)
Search MetaClass by the corresponding Java class in the whole metamodel.
|
MetaClass |
getClass(java.lang.String name)
Search MetaClass by its name in the whole metamodel.
|
java.util.Collection<MetaClass> |
getClasses() |
MetaClass |
getClassNN(java.lang.Class<?> clazz)
Search MetaClass by the corresponding Java class in the whole metamodel.
|
MetaClass |
getClassNN(java.lang.String name)
Search MetaClass by its name in the whole metamodel.
|
DatatypeRegistry |
getDatatypes()
Convenient access to
DatatypeRegistry bean. |
protected java.lang.String |
getEntityNameForIdGeneration(MetaClass metaClass) |
ExtendedEntities |
getExtendedEntities()
Convenient access to
ExtendedEntities bean. |
MetaModel |
getModel(java.lang.String name) |
java.util.Collection<MetaModel> |
getModels() |
protected java.util.List<java.lang.reflect.Method> |
getPostConstructMethodsNotCached(java.lang.Class<?> clazz) |
java.util.List<java.lang.String> |
getRootPackages() |
Session |
getSession()
Get Metadata session - interface providing access to MetaClasses and MetaProperties.
|
MetadataTools |
getTools()
Convenient access to
MetadataTools bean. |
ViewRepository |
getViewRepository()
Convenient access to
ViewRepository bean. |
protected void |
initMetadata() |
protected void |
invokePostConstructMethods(Entity entity) |
protected volatile Session session
protected volatile java.util.List<java.lang.String> rootPackages
@Inject protected DatatypeRegistry datatypeRegistry
@Inject protected ViewRepository viewRepository
@Inject protected ExtendedEntities extendedEntities
@Inject protected MetadataTools tools
@Inject protected Resources resources
@Inject protected NumberIdSource numberIdSource
@Inject protected org.springframework.context.ApplicationContext applicationContext
@Inject protected GlobalConfig config
protected com.google.common.cache.LoadingCache<java.lang.Class<?>,java.util.List<java.lang.reflect.Method>> postConstructMethodsCache
@EventListener(value=AppContextInitializedEvent.class) @Order(value=110) protected void initMetadata()
public Session getSession()
Metadata
getSession
in interface Metadata
public ViewRepository getViewRepository()
Metadata
ViewRepository
bean.getViewRepository
in interface Metadata
public ExtendedEntities getExtendedEntities()
Metadata
ExtendedEntities
bean.getExtendedEntities
in interface Metadata
public MetadataTools getTools()
Metadata
MetadataTools
bean.public DatatypeRegistry getDatatypes()
Metadata
DatatypeRegistry
bean.getDatatypes
in interface Metadata
protected <T extends Entity> T __create(java.lang.Class<T> entityClass)
protected void assignIdentifier(Entity entity)
protected java.lang.String getEntityNameForIdGeneration(MetaClass metaClass)
protected void assignUuid(Entity entity)
protected void createEmbedded(Entity entity)
protected void invokePostConstructMethods(Entity entity) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
protected java.util.List<java.lang.reflect.Method> getPostConstructMethodsNotCached(java.lang.Class<?> clazz)
public <T extends Entity> T create(java.lang.Class<T> entityClass)
Metadata
public Entity create(MetaClass metaClass)
Metadata
public Entity create(java.lang.String entityName)
Metadata
public java.util.List<java.lang.String> getRootPackages()
getRootPackages
in interface Metadata
public MetaModel getModel(java.lang.String name)
public java.util.Collection<MetaModel> getModels()
@Nullable public MetaClass getClass(java.lang.String name)
Session
public MetaClass getClassNN(java.lang.String name)
Session
getClassNN
in interface Session
name
- entity name@Nullable public MetaClass getClass(java.lang.Class<?> clazz)
Session
public MetaClass getClassNN(java.lang.Class<?> clazz)
Session
getClassNN
in interface Session
clazz
- Java class defining the entitypublic java.util.Collection<MetaClass> getClasses()
getClasses
in interface Session