@Component(value="cuba_PersistenceManager") public class PersistenceManager extends java.lang.Object implements PersistenceManagerAPI
Modifier and Type | Field and Description |
---|---|
protected PersistenceConfig |
config |
protected Metadata |
metadata |
protected Persistence |
persistence |
protected PersistenceSecurity |
security |
protected java.util.Map<java.lang.String,EntityStatistics> |
statisticsCache |
NAME
Constructor and Description |
---|
PersistenceManager() |
Modifier and Type | Method and Description |
---|---|
void |
deleteStatistics(java.lang.String name) |
EntityStatistics |
enterStatistics(java.lang.String name,
java.lang.Long instanceCount,
java.lang.Integer fetchUI,
java.lang.Integer maxFetchUI,
java.lang.Integer lazyCollectionThreshold,
java.lang.Integer lookupScreenThreshold) |
void |
flushStatisticsCache() |
java.util.SortedMap<java.lang.String,EntityStatistics> |
getEntityStatistics() |
protected EntityStatistics |
getEntityStatisticsInstance(java.lang.String name,
EntityManager em) |
int |
getFetchUI(java.lang.String entityName)
Return a limit of rows fetched for UI components in 'normal' conditions
|
int |
getMaxFetchUI(java.lang.String entityName)
Return the absolute maximum number of rows that can be fetched for UI components
|
protected java.lang.String |
getOriginalOrThisEntityName(java.lang.String entityName) |
protected java.util.Map<java.lang.String,EntityStatistics> |
getStatisticsCache() |
protected void |
internalLoadStatisticsCache() |
void |
refreshStatisticsForEntity(java.lang.String name) |
void |
setConfiguration(Configuration configuration) |
boolean |
useLazyCollection(java.lang.String entityName)
Whether to use a lazy collection datasource for this entity, based on current statistics.
|
boolean |
useLookupScreen(java.lang.String entityName)
Whether to use a lookup screen or a dropdown for this entity, based on current statistics.
|
protected java.util.Map<java.lang.String,EntityStatistics> statisticsCache
@Inject protected Persistence persistence
@Inject protected Metadata metadata
@Inject protected PersistenceSecurity security
protected PersistenceConfig config
@Inject public void setConfiguration(Configuration configuration)
public boolean useLazyCollection(java.lang.String entityName)
PersistenceManagerAPI
useLazyCollection
in interface PersistenceManagerAPI
entityName
- entity namepublic boolean useLookupScreen(java.lang.String entityName)
PersistenceManagerAPI
useLookupScreen
in interface PersistenceManagerAPI
entityName
- entity namepublic int getFetchUI(java.lang.String entityName)
PersistenceManagerAPI
getFetchUI
in interface PersistenceManagerAPI
entityName
- entity namepublic int getMaxFetchUI(java.lang.String entityName)
PersistenceManagerAPI
getMaxFetchUI
in interface PersistenceManagerAPI
entityName
- entity nameprotected java.util.Map<java.lang.String,EntityStatistics> getStatisticsCache()
protected void internalLoadStatisticsCache()
public void flushStatisticsCache()
flushStatisticsCache
in interface PersistenceManagerAPI
public EntityStatistics enterStatistics(java.lang.String name, java.lang.Long instanceCount, java.lang.Integer fetchUI, java.lang.Integer maxFetchUI, java.lang.Integer lazyCollectionThreshold, java.lang.Integer lookupScreenThreshold)
enterStatistics
in interface PersistenceManagerAPI
public java.util.SortedMap<java.lang.String,EntityStatistics> getEntityStatistics()
getEntityStatistics
in interface PersistenceManagerAPI
public void deleteStatistics(java.lang.String name)
deleteStatistics
in interface PersistenceManagerAPI
public void refreshStatisticsForEntity(java.lang.String name)
refreshStatisticsForEntity
in interface PersistenceManagerAPI
protected EntityStatistics getEntityStatisticsInstance(java.lang.String name, EntityManager em)
protected java.lang.String getOriginalOrThisEntityName(java.lang.String entityName)