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
Modifier and TypeFieldDescriptionprotected org.springframework.core.env.Environment
protected ExtendedEntities
protected FetchPlanLoader
protected FetchPlans
protected boolean
protected ReadWriteLock
protected Metadata
protected MetadataTools
protected JmixModules
protected Resources
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttributesToBaseFetchPlan
(MetaClass metaClass, FetchPlanBuilder fetchPlanBuilder, FetchPlanLoader.FetchPlanInfo info, Set<FetchPlanLoader.FetchPlanInfo> visited) protected void
addAttributesToInstanceNameFetchPlan
(MetaClass metaClass, FetchPlanBuilder fetchPlanBuilder, FetchPlanLoader.FetchPlanInfo info, Set<FetchPlanLoader.FetchPlanInfo> visited) protected void
addAttributesToLocalFetchPlan
(MetaClass metaClass, FetchPlanBuilder fetchPlanBuilder) protected void
addClassAttributeWithFetchPlan
(MetaProperty metaProperty, String fetchPlanName, FetchPlanBuilder fetchPlanBuilder, FetchPlanLoader.FetchPlanInfo info, Set<FetchPlanLoader.FetchPlanInfo> visited) protected void
protected void
protected FetchPlan
deployDefaultFetchPlan
(MetaClass metaClass, String name, Set<FetchPlanLoader.FetchPlanInfo> visited) deployFetchPlan
(org.dom4j.Element rootElem, org.dom4j.Element fetchPlanElem) protected FetchPlan
deployFetchPlan
(org.dom4j.Element rootElem, org.dom4j.Element fetchPlanElem, Set<FetchPlanLoader.FetchPlanInfo> visited) void
void
deployFetchPlans
(Reader xml) void
deployFetchPlans
(String resourceUrl) findFetchPlan
(MetaClass metaClass, String name) Searches for a FetchPlan for an entitygetAll()
protected FetchPlan
getAncestorFetchPlan
(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 void
init()
protected boolean
isDefaultFetchPlan
(String fetchPlanName) protected boolean
isPersistent
(MetaClass metaClass, MetaProperty metaProperty) protected void
replaceOverridden
(FetchPlan replacementFetchPlan) protected FetchPlanBuilder
replaceOverridden
(FetchPlan root, FetchPlan replacementFetchPlan, HashSet<FetchPlan> checked) void
reset()
protected FetchPlan
retrieveFetchPlan
(MetaClass metaClass, String name, Set<FetchPlanLoader.FetchPlanInfo> visited) protected void
storeFetchPlan
(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:
getFetchPlan
in interfaceFetchPlanRepository
- Parameters:
entityClass
- entity classname
- fetch plan name- Returns:
- fetch plan instance. Throws
FetchPlanNotFoundException
if not found.
-
getFetchPlan
Get FetchPlan for an entity.- Specified by:
getFetchPlan
in interfaceFetchPlanRepository
- Parameters:
metaClass
- entity classname
- fetch plan name- Returns:
- fetch plan instance. Throws
FetchPlanNotFoundException
if not found.
-
findFetchPlan
Searches for a FetchPlan for an entity- Specified by:
findFetchPlan
in interfaceFetchPlanRepository
- Parameters:
metaClass
- entity classname
- fetch plan name- Returns:
- fetch plan instance or null if no fetch plan found
-
getFetchPlanNames
Description copied from interface:FetchPlanRepository
Returns names of fetch plans defined for the metaClass- Specified by:
getFetchPlanNames
in interfaceFetchPlanRepository
- Parameters:
metaClass
- entity class- Returns:
- names of fetch plans
-
getFetchPlanNames
Description copied from interface:FetchPlanRepository
Returns names of fetch plans defined for the entityClass- Specified by:
getFetchPlanNames
in 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) -
isPersistent
-
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
root
or null if no replacement needed
-
getAncestorFetchPlan
protected FetchPlan getAncestorFetchPlan(MetaClass metaClass, String ancestor, Set<FetchPlanLoader.FetchPlanInfo> visited) -
storeFetchPlan
-
getAllInitialized
-
getAll
-