public class UnlazyUpdateStrategy extends java.lang.Object implements CachingBOLoaderUpdateStrategyI
Precomputes the graph of entities and classes to keep synchronized in the CachingBOLoader
based on root classes, persistent relations and configured unlazy paths.
Graph traversals and sub-entity attribute expansions are handled by SchemaUtils.
CachingBOLoaderUpdateStrategyI,
SchemaUtils| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<java.lang.Class<?>> |
DEFAULT_IGNORE_CLASSES_FOR_UPDATING
Internal classes that are unmodifiable by default and ignored during cache updates.
|
$0| Constructor and Description |
|---|
UnlazyUpdateStrategy(SchemaI schema,
java.util.Collection<java.lang.Class<?>> rootClasses,
java.util.Collection<java.lang.String> unlazyUpdateInformation,
java.util.Set<java.lang.Class<?>> ignoredClassesWhenUpdating)
Creates and initializes a new update strategy.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<EntityI,java.util.Set<AttributeI>> |
getFullUnlazyMap()
Returns the internal mapping of all entities to their expanded unlazy attributes.
|
java.util.Set<EntityI> |
getMonitoredEntities()
Returns the entity types to register with the database change listener.
|
static java.util.Collection<java.lang.String> |
getNetwork(BO bo,
java.util.Set<java.lang.String> recursionGuard,
boolean onlyManyRelations)
Deprecated.
|
SchemaI |
getSchema()
Returns the active schema.
|
java.util.Set<AttributeI> |
getUnlazyManyrelations(java.lang.Class clazz)
Returns all unlazy many-relation attributes configured for the given BO class.
|
java.util.Set<AttributeI> |
getUnlazyManyrelations(EntityI entity)
Returns all unlazy many-relation attributes configured for the given entity.
|
boolean |
hasUnlazyManyrelations(java.lang.Class clazz)
Checks whether the given BO class has any configured unlazy many-relations.
|
boolean |
hasUnlazyManyrelations(EntityI entity)
Checks whether the given entity has any configured unlazy many-relations.
|
boolean |
isEagerLoadingEnabled()
Determines whether newly created server objects matching the monitored entities
should be eagerly loaded into the cache even if not previously cached.
|
boolean |
isMonitoredClass(java.lang.Class aClass)
Evaluates whether a specific BO class requires cache synchronization.
|
boolean |
isUnlazy(EntityI entity,
AttributeI attr)
Evaluates whether a specific relation attribute should be loaded unlazily for an entity.
|
void |
setSchema(SchemaI schema)
Updates the active schema and triggers a complete cache re-initialization if the instance changed.
|
public static final java.util.Set<java.lang.Class<?>> DEFAULT_IGNORE_CLASSES_FOR_UPDATING
public UnlazyUpdateStrategy(SchemaI schema, java.util.Collection<java.lang.Class<?>> rootClasses, java.util.Collection<java.lang.String> unlazyUpdateInformation, java.util.Set<java.lang.Class<?>> ignoredClassesWhenUpdating)
schema - schema for entity lookups; must not be nullrootClasses - root BO classes marking graph entry points; must not be nullunlazyUpdateInformation - configuration strings (e.g. "Entity#attribute"); must not be nullignoredClassesWhenUpdating - classes to exclude from updates; must not be nullpublic java.util.Set<EntityI> getMonitoredEntities()
Only changes to business objects belonging to these entities trigger update evaluation.
Returns all schema entities discovered via reachability traversal from the configured root classes across persistent single and configured unlazy many-relations.
getMonitoredEntities in interface CachingBOLoaderUpdateStrategyIpublic boolean isMonitoredClass(java.lang.Class aClass)
Acts as a concrete type filter for polymorphic entities returned by CachingBOLoaderUpdateStrategyI.getMonitoredEntities().
Called only for classes whose entity definition is included in CachingBOLoaderUpdateStrategyI.getMonitoredEntities().
Performs a constant-time reference equality check against precomputed reachable classes.
isMonitoredClass in interface CachingBOLoaderUpdateStrategyIaClass - concrete BO class to evaluatetrue if the class is reachable from configured roots; false otherwisepublic boolean isEagerLoadingEnabled()
If false, updates are applied strictly to objects already resident in the cache or linked via currently unlazied many-relations.
Returns false; this strategy restricts cache synchronization exclusively
to already-cached objects or objects attached to active, unlazied relation paths.
isEagerLoadingEnabled in interface CachingBOLoaderUpdateStrategyIfalsepublic SchemaI getSchema()
public void setSchema(SchemaI schema)
schema - new schema instancepublic java.util.Set<AttributeI> getUnlazyManyrelations(java.lang.Class clazz)
clazz - business object classpublic java.util.Set<AttributeI> getUnlazyManyrelations(EntityI entity)
entity - target schema entitypublic boolean isUnlazy(EntityI entity, AttributeI attr)
Single relations (n-1) are always treated as unlazy; many-relations (1-n, n-m) require explicit configuration.
entity - owning schema entityattr - relation attribute to inspecttrue if unlazy loading is required; false otherwisepublic boolean hasUnlazyManyrelations(java.lang.Class clazz)
clazz - business object classtrue if at least one unlazy many-relation is configured; false otherwisepublic boolean hasUnlazyManyrelations(EntityI entity)
entity - schema entity to inspecttrue if at least one unlazy many-relation is configured; false otherwisepublic java.util.Map<EntityI,java.util.Set<AttributeI>> getFullUnlazyMap()
@Deprecated public static java.util.Collection<java.lang.String> getNetwork(BO bo, java.util.Set<java.lang.String> recursionGuard, boolean onlyManyRelations)
SchemaUtils.findUnlazyPaths(BOI, Set, boolean).
Call SchemaUtils.findUnlazyPaths(de.ipcon.schema.BOI, java.util.Set<java.lang.String>, boolean) directly.bo - business object to inspectrecursionGuard - visited path accumulatoronlyManyRelations - true to restrict analysis to many-relationsCopyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.