public interface InstrumentingSchemaI extends SchemaI
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
$0 |
ATT_NAME_DEFAULT_PACKAGE, INITIALDATA_LINE_ENCLOSING_CHAR, INITIALDATA_LINE_SEPARATOR_CHAR, INITIALDATA_SCHEMA_ADDITIONS_FILENAME, MD_DISABLE, MD_NON_DESTRUCTIVE, MD_RECREATE_INDEXES, NAME_MINLENGTH, RELATION_TYPE_1_N, RELATION_TYPE_N_1, RELATION_TYPE_N_M, SUFFIX_FOLDER_KEY
Modifier and Type | Method and Description |
---|---|
void |
addDefinerFuture(java.util.concurrent.Future f) |
void |
addInitFuture(java.util.concurrent.Future f) |
EntityI |
addVirtualEntity(BasicEntityI baseEntity,
java.lang.String name)
Creates a new virtual sub entity to this schema and its namespace.
|
EntityI |
addVirtualEntity(java.lang.String baseEntityName,
java.lang.String name)
Creates a new VirtualEntity extending the given BaseEntity and returns it.
|
AttributeI |
addVirtualProperty(electric.xml.Element el)
Adds a virtual property to this schema using an XML element.
|
AttributeI |
addVirtualProperty(electric.xml.Element el,
java.util.Map parameters)
Adds a virtual property to this schema using an XML element.
|
AttributeI |
addVirtualProperty(electric.xml.Element el,
java.util.Map parameters,
boolean ignoreError)
Adds a virtual property to this schema using an XML element definition.
|
AttributeI |
addVirtualProperty(java.util.Map def)
Creates a new virtual property using a definition from a flat map.
|
AttributeI |
addVirtualProperty(java.util.Map def,
java.util.Map parameters)
Creates a new virtual property using a definition from a flat map.
|
AttributeI |
addVirtualProperty(java.util.Map def,
java.util.Map parameters,
boolean ignoreError)
Creates a new virtual property using a definition from a flat map.
|
EntityI |
coerceEntity(EntityI e,
java.lang.String reason)
Wraps and returns the wrapped EntityI into this InstrumentingSchemaI
|
java.util.List<EntityI> |
coerceEntityList(java.util.List<EntityI> l,
java.lang.String reason) |
void |
flushCaches()
Iterates over all Entities and flushes caches which may contain references to
previously loaded BOs, e.g. the value cache in ScriptedAttributes.
|
java.util.function.Consumer<SetValueEventI> |
getDefaultSetValueCallback() |
java.util.List<EntityI> |
getVirtualSubEntityList(EntityI baseEntity) |
java.util.List<EntityI> |
getVirtualSubEntityList(java.lang.String baseEntityName) |
boolean |
hasVirtualSubEntities(EntityI baseEntity) |
boolean |
hasVirtualSubEntities(java.lang.String baseEntityName) |
java.util.List<java.lang.Throwable> |
waitForCompilationAndGetErrors() |
void |
waitForDefinerCompilation() |
addRelationObject, aggregate, aggregate, aggregate, aggregate, checkSyntacticallyValid, createFunction, createFunction, createFunction, createFunction, createFunction, createFunction, createFunctionFromXML, createFunctionFromXML, createFunctionFromXML, createFunctionFromXML, describe, describe, describe, describe, describeNE, describeNE, describeNE, describeNE, filterEntities, flattenToString, getAnnotatedValue, getAnnotatedValue, getAnnotatedValueAsString, getAnnotatedValueAsString, getAttribute, getAttribute, getBOForLastPathElement, getBundleLookupPath, getClosestAvailableAggregateAnchor, getCoreEntityList, getCryptoHandler, getCurrentFolder, getCurrentModuleOrProject, getCurrentModulePackage, getDefaultImports, getDefaultPackage, getDiscriminators, getEntitiesForInterface, getEntity, getEntity, getEntityForClass, getEntityForClassName, getEntityForObject, getEntityList, getEntityOrAttributeNameValidationError, getFingerprint, getFormatter, getFormatter, getFormatter, getFormatter, getFrappingAttributes, getGDPRConfigElements, getInterface, getInterfaces, getLowestCommonDenominateEntity, getModuleEntityList, getNonPersistentAttributes, getPackageList, getPermissionHandler, getProjectEntityList, getProjectInterfaces, getProjectPackage, getProperty, getProperty, getRegisteredModuleProviders, getRelationObjects, getScript, getScript, getSerializationRelevantDiff, getSerialVersionUIDs, getSubScript, getSubScript, getSubScript, getSubScript, getSubScript, getSubScript, getToolTipBundleLookupPath, getType, getUsedModules, getValue, getValue, getValue, getValue, getValueAsString, getValueAsString, getValueAsString, getVersion, hasRelationObject, isUsingModules, parseGuiTips, parseGuiTips, releaseDefinitionSource, removeRelationObject, setCryptoHandler, setPermissionHandler, setProperty, setValue, setValueAsString, setValueAsString, splitInitialDataLine
static final java.lang.String $0
AttributeI addVirtualProperty(electric.xml.Element el, java.util.Map parameters, boolean ignoreError)
If a virtual property with the same name already exists within the entity's context,
the existing property is returned, and the new definition is ignored. This behavior
ensures that an existing, valid property is not accidentally overwritten.
If the name is already defined by a different type of attribute (e.g. a physical database column),
a RuntimeException
may be thrown, depending on the ignoreError
flag.
el
- The non-null root 'virtualProperty' XML element defining the property.parameters
- A map of additional parameters (String -> Object) to be injected into
the property's scripts at execution time (e.g. a logger or context accessor).ignoreError
- If true
, and the virtual property cannot be constructed
(e.g. due to a naming clash or invalid script), exceptions are caught,
logged, and the method returns null
.
If false
, the exception is re-thrown.null
if the property could not be constructed and the error was ignored.java.lang.RuntimeException
- if ignoreError is false
and the property cannot be constructed
due to an error.ScriptedAttribute
AttributeI addVirtualProperty(electric.xml.Element el, java.util.Map parameters)
This is a convenience method that delegates to
addVirtualProperty(Element, Map, boolean)
, with error handling set to
not ignore errors by default.
el
- The non-null root 'virtualProperty' XML element defining the property.parameters
- A map of additional parameters.java.lang.RuntimeException
- if the property cannot be constructed due to an error.AttributeI addVirtualProperty(electric.xml.Element el)
This is a convenience method that delegates to
addVirtualProperty(Element, Map, boolean)
, using a default 'null'
for parameters and not ignoring errors.
el
- The non-null root 'virtualProperty' XML element defining the property.java.lang.RuntimeException
- if ignoreError is false
and the property cannot be constructed
due to an error.AttributeI addVirtualProperty(java.util.Map def, java.util.Map parameters, boolean ignoreError)
This method provides a programmatic way to define a virtual property. The keys in the map correspond to the attributes of the XML element, and script values are expected to be Groovy closures.
def
- The map containing key-value pairs that define the virtual property.parameters
- A map of additional parameters to be injected into the scripts.ignoreError
- If true
, and the property cannot be constructed,
exceptions are caught and the method returns null
.null
if an error occurred
and was ignored.java.lang.RuntimeException
- if the property cannot be constructed due to an error.ScriptedAttribute
AttributeI addVirtualProperty(java.util.Map def, java.util.Map parameters)
This convenience method delegates to
addVirtualProperty(Map, Map, boolean)
, with error handling set to
not ignore errors by default.
def
- The map containing key-value pairs that define the virtual property.parameters
- A map of additional parameters.java.lang.RuntimeException
- if the property cannot be constructed due to an error.AttributeI addVirtualProperty(java.util.Map def)
This convenience method delegates to
addVirtualProperty(Map, Map, boolean)
, using a default 'null'
for parameters and not ignoring errors.
def
- The map containing key-value pairs that define the virtual property.java.lang.RuntimeException
- if the property cannot be constructed due to an error.EntityI coerceEntity(EntityI e, java.lang.String reason)
java.util.List<EntityI> coerceEntityList(java.util.List<EntityI> l, java.lang.String reason)
java.util.function.Consumer<SetValueEventI> getDefaultSetValueCallback()
void flushCaches()
EntityI addVirtualEntity(BasicEntityI baseEntity, java.lang.String name)
BOI.getEntity()
or SchemaI.getEntityForClass(java.lang.Class)
, but the virtual entity
when using SchemaI.getEntityForObject(java.lang.Object)
.
Adding virtual properties to these is allowed, e.g. to create virtual namespaces for otherwise clashing
attribute definitions.baseEntity
- a nonnull BasicEntityI instance to add the virtualEntity to.name
- the name of the VirtualEntity to create, nonnull.EntityI addVirtualEntity(java.lang.String baseEntityName, java.lang.String name)
baseEntityName
- the name of the EntityI instance to add this entity to.name
- the name of the VirtualEntity to create, nonnull.java.util.List<EntityI> getVirtualSubEntityList(EntityI baseEntity)
java.util.List<EntityI> getVirtualSubEntityList(java.lang.String baseEntityName)
boolean hasVirtualSubEntities(EntityI baseEntity)
boolean hasVirtualSubEntities(java.lang.String baseEntityName)
void addDefinerFuture(java.util.concurrent.Future f)
void waitForDefinerCompilation()
void addInitFuture(java.util.concurrent.Future f)
java.util.List<java.lang.Throwable> waitForCompilationAndGetErrors()
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.