Package io.ebeaninternal.server.deploy
Class BeanDescriptorManager
- java.lang.Object
-
- io.ebeaninternal.server.deploy.BeanDescriptorManager
-
- All Implemented Interfaces:
BeanDescriptorMap
public class BeanDescriptorManager extends Object implements BeanDescriptorMap
Creates BeanDescriptors.
-
-
Constructor Summary
Constructors Constructor Description BeanDescriptorManager(InternalConfiguration config)
Create for a given database dbConfig.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cacheNotify(TransactionEventTable.TableIUD tableIUD, CacheChangeSet changeSet)
For SQL based modifications we need to invalidate appropriate parts of the cache.BeanTable
createCollectionBeanTable(String fullTableName, Class<?> targetType)
Return a BeanTable for an ElementCollection.<A> DeployBeanDescriptor<A>
createDeployDescriptor(Class<A> targetType)
Create a DeployBeanDescriptor for an ElementCollection target.<T> DocStoreBeanAdapter<T>
createDocStoreBeanAdapter(BeanDescriptor<T> descriptor, DeployBeanDescriptor<T> deploy)
Create a doc store specific adapter for this bean type.<A> BeanDescriptor<A>
createElementDescriptor(DeployBeanDescriptor<A> elementDescriptor, ManyType manyType, boolean scalar)
Create a BeanDescriptor for an ElementCollection target.IdBinder
createIdBinder(BeanProperty idProperty)
Create a IdBinder for this bean property.<A> void
createUnidirectional(DeployBeanDescriptor<?> targetDesc, Class<A> targetType, BeanTable beanTable, DeployTableJoin oneToManyJoin)
Create and add a Unidirectional property (for ElementCollection) which maps to the foreign key.Map<String,String>
deploy(List<XmEbean> mappings)
Deploy returning the asOfTableMap (which is required by the SQL builders).<T> BeanDescriptor<T>
getBeanDescriptor(Class<T> entityType)
Return the BeanDescriptor for a given class.<T> BeanDescriptor<T>
getBeanDescriptorByClassName(String entityClassName)
BeanDescriptor<?>
getBeanDescriptorByQueueId(String queueId)
List<BeanDescriptor<?>>
getBeanDescriptorList()
Return an immutable list of all the BeanDescriptors.List<BeanDescriptor<?>>
getBeanDescriptors(String tableName)
Return the BeanDescriptors mapped to the table.<T> BeanManager<T>
getBeanManager(Class<T> entityType)
BeanTable
getBeanTable(Class<?> type)
List<? extends BeanType<?>>
getBeanTypes(String tableName)
Return the BeanDescriptors mapped to the table.SpiCacheManager
getCacheManager()
Return the Cache Manager.ChangeLogListener
getChangeLogListener()
Return the changeLogListener (that actually does the logging).ChangeLogPrepare
getChangeLogPrepare()
Return the changeLogPrepare (for setting user context into the ChangeSet in the foreground thread).<T> DeployBeanInfo<T>
getDeploy(Class<T> cls)
Return the bean deploy info for the given class.Map<String,String>
getDraftTableMap()
Return the map of base tables to draft tables.EncryptKey
getEncryptKey(String tableName, String columnName)
Return the Encrypt key given the table and column name.NamingConvention
getNamingConvention()
Return the naming convention.ScalarType<?>
getScalarType(int jdbcType)
Return the scalarType for the given JDBC type.ScalarType<?>
getScalarType(String cast)
Return the scalarType for the given logical type.ServerConfig
getServerConfig()
Return the ServerConfig.String
getServerName()
Return the name of the server/database.boolean
isMultiValueSupported()
Return true if multiple values can be bound as Array or Table Value and hence share the same query plan.void
processViewInvalidation(Set<String> viewInvalidation)
Invalidate entity beans based on views via their dependent tables.List<MetaQueryPlan>
queryPlanInit(QueryPlanInit request)
boolean
requiresViewEntityCacheInvalidation()
Return true if there are 'view based entities' using l2 query caching and so need to be invalidated based on changes to dependent tables.void
scheduleBackgroundTrim()
Run periodic trim of query plans.void
setEbeanServer(SpiEbeanServer internalEbean)
Set the internal EbeanServer instance to all BeanDescriptors.void
visitMetrics(MetricVisitor visitor)
-
-
-
Constructor Detail
-
BeanDescriptorManager
public BeanDescriptorManager(InternalConfiguration config)
Create for a given database dbConfig.
-
-
Method Detail
-
scheduleBackgroundTrim
public void scheduleBackgroundTrim()
Run periodic trim of query plans.
-
getScalarType
public ScalarType<?> getScalarType(String cast)
Description copied from interface:BeanDescriptorMap
Return the scalarType for the given logical type.- Specified by:
getScalarType
in interfaceBeanDescriptorMap
-
getScalarType
public ScalarType<?> getScalarType(int jdbcType)
Description copied from interface:BeanDescriptorMap
Return the scalarType for the given JDBC type.- Specified by:
getScalarType
in interfaceBeanDescriptorMap
-
isMultiValueSupported
public boolean isMultiValueSupported()
Description copied from interface:BeanDescriptorMap
Return true if multiple values can be bound as Array or Table Value and hence share the same query plan.- Specified by:
isMultiValueSupported
in interfaceBeanDescriptorMap
-
getServerConfig
public ServerConfig getServerConfig()
Description copied from interface:BeanDescriptorMap
Return the ServerConfig.- Specified by:
getServerConfig
in interfaceBeanDescriptorMap
-
createDocStoreBeanAdapter
public <T> DocStoreBeanAdapter<T> createDocStoreBeanAdapter(BeanDescriptor<T> descriptor, DeployBeanDescriptor<T> deploy)
Description copied from interface:BeanDescriptorMap
Create a doc store specific adapter for this bean type.- Specified by:
createDocStoreBeanAdapter
in interfaceBeanDescriptorMap
-
getBeanDescriptorByQueueId
public BeanDescriptor<?> getBeanDescriptorByQueueId(String queueId)
-
getBeanDescriptor
public <T> BeanDescriptor<T> getBeanDescriptor(Class<T> entityType)
Description copied from interface:BeanDescriptorMap
Return the BeanDescriptor for a given class.- Specified by:
getBeanDescriptor
in interfaceBeanDescriptorMap
-
getBeanDescriptorByClassName
public <T> BeanDescriptor<T> getBeanDescriptorByClassName(String entityClassName)
-
getServerName
public String getServerName()
Description copied from interface:BeanDescriptorMap
Return the name of the server/database.- Specified by:
getServerName
in interfaceBeanDescriptorMap
-
getCacheManager
public SpiCacheManager getCacheManager()
Description copied from interface:BeanDescriptorMap
Return the Cache Manager.- Specified by:
getCacheManager
in interfaceBeanDescriptorMap
-
getNamingConvention
public NamingConvention getNamingConvention()
Description copied from interface:BeanDescriptorMap
Return the naming convention.- Specified by:
getNamingConvention
in interfaceBeanDescriptorMap
-
setEbeanServer
public void setEbeanServer(SpiEbeanServer internalEbean)
Set the internal EbeanServer instance to all BeanDescriptors.
-
createIdBinder
public IdBinder createIdBinder(BeanProperty idProperty)
Description copied from interface:BeanDescriptorMap
Create a IdBinder for this bean property.- Specified by:
createIdBinder
in interfaceBeanDescriptorMap
-
getDraftTableMap
public Map<String,String> getDraftTableMap()
Return the map of base tables to draft tables.
-
deploy
public Map<String,String> deploy(List<XmEbean> mappings)
Deploy returning the asOfTableMap (which is required by the SQL builders).
-
getEncryptKey
public EncryptKey getEncryptKey(String tableName, String columnName)
Return the Encrypt key given the table and column name.- Specified by:
getEncryptKey
in interfaceBeanDescriptorMap
-
cacheNotify
public void cacheNotify(TransactionEventTable.TableIUD tableIUD, CacheChangeSet changeSet)
For SQL based modifications we need to invalidate appropriate parts of the cache.
-
getBeanDescriptors
public List<BeanDescriptor<?>> getBeanDescriptors(String tableName)
Return the BeanDescriptors mapped to the table.
-
getBeanTypes
public List<? extends BeanType<?>> getBeanTypes(String tableName)
Return the BeanDescriptors mapped to the table.
-
processViewInvalidation
public void processViewInvalidation(Set<String> viewInvalidation)
Invalidate entity beans based on views via their dependent tables.
-
requiresViewEntityCacheInvalidation
public boolean requiresViewEntityCacheInvalidation()
Return true if there are 'view based entities' using l2 query caching and so need to be invalidated based on changes to dependent tables.
-
getBeanDescriptorList
public List<BeanDescriptor<?>> getBeanDescriptorList()
Return an immutable list of all the BeanDescriptors.
-
getBeanTable
public BeanTable getBeanTable(Class<?> type)
-
createCollectionBeanTable
public BeanTable createCollectionBeanTable(String fullTableName, Class<?> targetType)
Return a BeanTable for an ElementCollection.
-
getBeanManager
public <T> BeanManager<T> getBeanManager(Class<T> entityType)
-
getDeploy
public <T> DeployBeanInfo<T> getDeploy(Class<T> cls)
Return the bean deploy info for the given class.
-
createUnidirectional
public <A> void createUnidirectional(DeployBeanDescriptor<?> targetDesc, Class<A> targetType, BeanTable beanTable, DeployTableJoin oneToManyJoin)
Create and add a Unidirectional property (for ElementCollection) which maps to the foreign key.
-
getChangeLogPrepare
public ChangeLogPrepare getChangeLogPrepare()
Return the changeLogPrepare (for setting user context into the ChangeSet in the foreground thread).
-
getChangeLogListener
public ChangeLogListener getChangeLogListener()
Return the changeLogListener (that actually does the logging).
-
createDeployDescriptor
public <A> DeployBeanDescriptor<A> createDeployDescriptor(Class<A> targetType)
Create a DeployBeanDescriptor for an ElementCollection target.
-
createElementDescriptor
public <A> BeanDescriptor<A> createElementDescriptor(DeployBeanDescriptor<A> elementDescriptor, ManyType manyType, boolean scalar)
Create a BeanDescriptor for an ElementCollection target.
-
visitMetrics
public void visitMetrics(MetricVisitor visitor)
-
queryPlanInit
public List<MetaQueryPlan> queryPlanInit(QueryPlanInit request)
-
-