Package io.jmix.core.impl
Class FetchPlanRepositoryImpl
java.lang.Object
io.jmix.core.impl.FetchPlanRepositoryImpl
- All Implemented Interfaces:
FetchPlanRepository
@Component("core_FetchPlanRepository")
public class FetchPlanRepositoryImpl
extends Object
implements FetchPlanRepository
Implementation of the
FetchPlanRepository. Contains methods to store FetchPlan objects and deploy
them from XML.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.core.env.Environmentprotected ExtendedEntitiesprotected FetchPlanLoaderprotected FetchPlansprotected booleanprotected ReadWriteLockprotected Metadataprotected MetadataToolsprotected JmixModulesprotected Resources -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttributesToBaseFetchPlan(MetaClass metaClass, FetchPlanBuilder fetchPlanBuilder, FetchPlanLoader.FetchPlanInfo info, Set<FetchPlanLoader.FetchPlanInfo> visited) protected voidaddAttributesToInstanceNameFetchPlan(MetaClass metaClass, FetchPlanBuilder fetchPlanBuilder, FetchPlanLoader.FetchPlanInfo info, Set<FetchPlanLoader.FetchPlanInfo> visited) protected voidaddAttributesToLocalFetchPlan(MetaClass metaClass, FetchPlanBuilder fetchPlanBuilder) protected voidaddClassAttributeWithFetchPlan(MetaProperty metaProperty, String fetchPlanName, FetchPlanBuilder fetchPlanBuilder, FetchPlanLoader.FetchPlanInfo info, Set<FetchPlanLoader.FetchPlanInfo> visited) protected voidprotected voidprotected FetchPlandeployDefaultFetchPlan(MetaClass metaClass, String name, Set<FetchPlanLoader.FetchPlanInfo> visited) deployFetchPlan(org.dom4j.Element rootElem, org.dom4j.Element fetchPlanElem) protected FetchPlandeployFetchPlan(org.dom4j.Element rootElem, org.dom4j.Element fetchPlanElem, Set<FetchPlanLoader.FetchPlanInfo> visited) voidvoiddeployFetchPlans(Reader xml) voiddeployFetchPlans(String resourceUrl) findFetchPlan(MetaClass metaClass, String name) Searches for a FetchPlan for an entitygetAll()protected FetchPlangetAncestorFetchPlan(MetaClass metaClass, String ancestor, Set<FetchPlanLoader.FetchPlanInfo> visited) getFetchPlan(MetaClass metaClass, String name) Get FetchPlan for an entity.getFetchPlan(Class<?> entityClass, String name) Get FetchPlan for an entity.getFetchPlanNames(MetaClass metaClass) Returns names of fetch plans defined for the metaClassgetFetchPlanNames(Class<?> entityClass) Returns names of fetch plans defined for the entityClassprotected Collection<MetaProperty>getInstanceNamePersistentProperties(MetaClass metaClass) protected voidinit()protected booleanisDefaultFetchPlan(String fetchPlanName) protected voidreplaceOverridden(FetchPlan replacementFetchPlan) protected FetchPlanBuilderreplaceOverridden(FetchPlan root, FetchPlan replacementFetchPlan, HashSet<FetchPlan> checked) voidreset()protected FetchPlanretrieveFetchPlan(MetaClass metaClass, String name, Set<FetchPlanLoader.FetchPlanInfo> visited) protected voidstoreFetchPlan(MetaClass metaClass, FetchPlan fetchPlan)
-
Field Details
-
readFileNames
-
storage
-
environment
@Autowired protected org.springframework.core.env.Environment environment -
metadata
-
metadataTools
-
extendedEntities
-
resources
-
modules
-
fetchPlans
-
fetchPlanLoader
-
initialized
protected volatile boolean initialized -
lock
-
-
Constructor Details
-
FetchPlanRepositoryImpl
public FetchPlanRepositoryImpl()
-
-
Method Details
-
checkInitialized
protected void checkInitialized() -
init
protected void init() -
addFile
-
reset
@EventListener(org.springframework.context.event.ContextRefreshedEvent.class) @Order(140) public void reset() -
getFetchPlan
Get FetchPlan for an entity.- Specified by:
getFetchPlanin interfaceFetchPlanRepository- Parameters:
entityClass- entity classname- fetch plan name- Returns:
- fetch plan instance. Throws
FetchPlanNotFoundExceptionif not found.
-
getFetchPlan
Get FetchPlan for an entity.- Specified by:
getFetchPlanin interfaceFetchPlanRepository- Parameters:
metaClass- entity classname- fetch plan name- Returns:
- fetch plan instance. Throws
FetchPlanNotFoundExceptionif not found.
-
findFetchPlan
Searches for a FetchPlan for an entity- Specified by:
findFetchPlanin interfaceFetchPlanRepository- Parameters:
metaClass- entity classname- fetch plan name- Returns:
- fetch plan instance or null if no fetch plan found
-
getFetchPlanNames
Description copied from interface:FetchPlanRepositoryReturns names of fetch plans defined for the metaClass- Specified by:
getFetchPlanNamesin interfaceFetchPlanRepository- Parameters:
metaClass- entity class- Returns:
- names of fetch plans
-
getFetchPlanNames
Description copied from interface:FetchPlanRepositoryReturns names of fetch plans defined for the entityClass- Specified by:
getFetchPlanNamesin interfaceFetchPlanRepository- Parameters:
entityClass- entity class- Returns:
- names of fetch plans
-
deployDefaultFetchPlan
protected FetchPlan deployDefaultFetchPlan(MetaClass metaClass, String name, Set<FetchPlanLoader.FetchPlanInfo> visited) -
addAttributesToLocalFetchPlan
protected void addAttributesToLocalFetchPlan(MetaClass metaClass, FetchPlanBuilder fetchPlanBuilder) -
addAttributesToInstanceNameFetchPlan
protected void addAttributesToInstanceNameFetchPlan(MetaClass metaClass, FetchPlanBuilder fetchPlanBuilder, FetchPlanLoader.FetchPlanInfo info, Set<FetchPlanLoader.FetchPlanInfo> visited) -
addAttributesToBaseFetchPlan
protected void addAttributesToBaseFetchPlan(MetaClass metaClass, FetchPlanBuilder fetchPlanBuilder, FetchPlanLoader.FetchPlanInfo info, Set<FetchPlanLoader.FetchPlanInfo> visited) -
addClassAttributeWithFetchPlan
protected void addClassAttributeWithFetchPlan(MetaProperty metaProperty, String fetchPlanName, FetchPlanBuilder fetchPlanBuilder, FetchPlanLoader.FetchPlanInfo info, Set<FetchPlanLoader.FetchPlanInfo> visited) -
getInstanceNamePersistentProperties
-
deployFetchPlans
-
deployFetchPlans
-
deployFetchPlans
-
retrieveFetchPlan
@Nullable protected FetchPlan retrieveFetchPlan(MetaClass metaClass, String name, Set<FetchPlanLoader.FetchPlanInfo> visited) -
isDefaultFetchPlan
-
deployFetchPlan
-
deployFetchPlan
protected FetchPlan deployFetchPlan(org.dom4j.Element rootElem, org.dom4j.Element fetchPlanElem, Set<FetchPlanLoader.FetchPlanInfo> visited) -
replaceOverridden
-
replaceOverridden
@Nullable protected FetchPlanBuilder replaceOverridden(FetchPlan root, FetchPlan replacementFetchPlan, HashSet<FetchPlan> checked) - Returns:
- FetchPlanBuilder to replace
rootor null if no replacement needed
-
getAncestorFetchPlan
protected FetchPlan getAncestorFetchPlan(MetaClass metaClass, String ancestor, Set<FetchPlanLoader.FetchPlanInfo> visited) -
storeFetchPlan
-
getAllInitialized
-
getAll
-