jsdai.lang
Interface EMappedARMEntity

All Superinterfaces:
EEntity, SdaiEventSource
All Known Implementing Classes:
CMappedARMEntity

public interface EMappedARMEntity
extends EEntity

A common supertype for all ARM entity types that support mapping operations. It contains methods to access assign ARM data from AIM population and to create AIM data from ARM subpopulation.


Field Summary
static int ATTRIBUTES_MODIFIED
          The instance state when the attribute values are known and at least one attribute was modified.
static int ATTRIBUTES_UNKNOWN
          The instance state when the attribute values are unknown.
static int ATTRIBUTES_UNMODIFIED
          The instance state when the attribute values are known and not modified.
 
Fields inherited from interface jsdai.lang.EEntity
MANDATORY_ATTRIBUTES_SET, MOST_SPECIFC_ENTITY, NO_RESTRICTIONS
 
Method Summary
 boolean applyMappedAttributes(SdaiContext context)
          Applies mapped (AIM) attribute values to this ARM instance.
 boolean assignMappedValue(SdaiContext context, jsdai.dictionary.EExplicit_attribute attribute, java.lang.Object attrValue, jsdai.dictionary.ANamed_type dataType)
          Assigns (sets) value of mapped attribute.
 boolean assignMappedValue(SdaiContext context, jsdai.dictionary.EExplicit_attribute attribute, java.lang.Object attrValue, jsdai.mapping.EGeneric_attribute_mapping genAttMapping)
          Assigns (sets) value of mapped attribute.
 void createAimData(SdaiContext context)
          Creates AIM data from ARM subpopulation starting from this ARM instance.
 int findARMEntityMappings(SdaiContext context, jsdai.mapping.AEntity_mapping mappings, int mode)
          Returns the entity_mappings alternatives for this instance type.
 EEntity getAimInstance()
          Returns the AIM instance which corresponds this ARM instance
 jsdai.mapping.EGeneric_attribute_mapping getAttributeMapping(jsdai.dictionary.EExplicit_attribute attr)
          Returns the attribute mapping of an attribute.
 int getAttributeState()
          Returns this instance attribute state.
 jsdai.dictionary.EEntity_definition getMappingTarget(SdaiContext context)
          Returns the AIM entity type definition to which this instance maps.
 EMappedARMEntity getNextArmInstance()
          Returns next ARM instance which is linked to the same AIM instance as this one.
 void removeAimData(SdaiContext context)
          Removes AIM data which corresponds this ARM instance.
 void setAimInstance(EEntity aimInstance)
          Sets AIM instance which corresponds this ARM instance.
 void setAttributeState(int attributeState)
          Sets this instance attribute state.
 void setMappingTarget(jsdai.dictionary.EEntity_definition edef)
          Sets the AIM entity type definition to which this instance is supposed to map.
 void unsetMappingTarget()
          Unsets (clears) the AIM entity type definition to which this instance maps.
 
Methods inherited from interface jsdai.lang.EEntity
buildMappedInstance, compareValuesBoolean, compareValuesLogical, copyApplicationInstance, copyValuesFrom, createAggregate, createExternalData, deleteApplicationInstance, findEntityInstanceSdaiModel, findEntityInstanceUsedin, findEntityInstanceUsers, findEntityMappings, findEntityMappings, findInstanceDataTypes, findInstanceRoles, findLinkedMappedInstance, findMappedUsers, findMostSpecificMappings, get_boolean, get_double, get_int, get_inverse, get_object, get, getAllReferences, getAttributeDefinition, getAttributeValueBound, getDescription, getExternalData, getInstanceType, getMappedAttribute, getMappedAttribute, getPersistentLabel, getTemp, getTemp, hasMappedAttribute, isInstanceOf, isInstanceOf, isKindOf, isKindOf, isValid, moveUsersFrom, removeExternalData, set, set, set, set, set, setTemp, setTemp, testAttribute, testExternalData, testMappedAttribute, testMappedAttribute, testMappedEntity, testMappedEntity, typeOf, toString, unsetAttributeValue, validateAggregatesSize, validateAggregatesUniqueness, validateArrayNotOptional, validateBinaryWidth, validateExplicitAttributesReferences, validateInverseAttributes, validateInverseAttributes, validateRealPrecision, validateRequiredExplicitAttributesAssigned, validateStringWidth, validateWhereRule, validateWhereRule
 
Methods inherited from interface jsdai.lang.SdaiEventSource
addSdaiListener, removeSdaiListener
 

Field Detail

ATTRIBUTES_UNKNOWN

public static final int ATTRIBUTES_UNKNOWN
The instance state when the attribute values are unknown. All attribute values are unset but no set operations on the attribute values are permitted. The instance is in this state when the instance is returned from EEntity.buildMappedInstance(jsdai.lang.SdaiContext, jsdai.dictionary.EEntity_definition) method.

See Also:
Constant Field Values

ATTRIBUTES_UNMODIFIED

public static final int ATTRIBUTES_UNMODIFIED
The instance state when the attribute values are known and not modified. Attribute values can be accessed using get and test methods and modified using set and unset methods. The instance is in this state after applyMappedAttributes(jsdai.lang.SdaiContext) method

See Also:
Constant Field Values

ATTRIBUTES_MODIFIED

public static final int ATTRIBUTES_MODIFIED
The instance state when the attribute values are known and at least one attribute was modified. The changes to the values can be applied to AIM data by invoking createAimData(jsdai.lang.SdaiContext) method. The instance changes to this state from ATTRIBUTES_UNMODIFIED when any change on any attribute value is made.

See Also:
Constant Field Values
Method Detail

createAimData

public void createAimData(SdaiContext context)
                   throws SdaiException
Creates AIM data from ARM subpopulation starting from this ARM instance.

Parameters:
context - The context of this operation. The following fields of SdaiContext have to be set: domain, mappingDomain, and working_model
Throws:
SdaiException - if an error occurs during AIM data creation or in underlying JSDAI operations
See Also:
JSDAI Mapping Extension

removeAimData

public void removeAimData(SdaiContext context)
                   throws SdaiException
Removes AIM data which corresponds this ARM instance. This method works like EEntity.deleteApplicationInstance() but works on AIM population and is mapping based.

Parameters:
context - The context of this operation. The following fields of SdaiContext have to be set: domain, mappingDomain, and working_model
Throws:
SdaiException - if an error occurs during removal of AIM data or in underlying JSDAI operations
See Also:
JSDAI Mapping Extension

getAimInstance

public EEntity getAimInstance()
Returns the AIM instance which corresponds this ARM instance

Returns:
The AIM instance or null if there is no AIM instance linked to this ARM instance.

setAimInstance

public void setAimInstance(EEntity aimInstance)
Sets AIM instance which corresponds this ARM instance. Invoking this methods establishes two directional link between ARM and AIM.

Parameters:
aimInstance - The AIM instance to be linked to this ARM instance
See Also:
JSDAI Mapping Extension

getNextArmInstance

public EMappedARMEntity getNextArmInstance()
Returns next ARM instance which is linked to the same AIM instance as this one.

Returns:
The next ARM instance or null if there is no more ARM instance linked to the same AIM instance.
Since:
3.6.0

assignMappedValue

public boolean assignMappedValue(SdaiContext context,
                                 jsdai.dictionary.EExplicit_attribute attribute,
                                 java.lang.Object attrValue,
                                 jsdai.mapping.EGeneric_attribute_mapping genAttMapping)
                          throws SdaiException
Assigns (sets) value of mapped attribute.

Parameters:
context - The context of this operation. The following fields of SdaiContext have to be set: domain, mappingDomain, working_model, and mappedWorkingModel
attribute - The attribute to assign value to
attrValue - The attribute value. This can be one of:
  • object corresponding simple type;
  • EEntity for entity instances;
  • either AEntity or Collection for aggregates
EEntity instances have to be target (AIM) instances
genAttMapping - The EGeneric_attribute_mapping which provides type information for the value
Returns:
true is value was assigned to the attribute and false otherwise.
Throws:
SdaiException - if an error occurs during attribute assignment from AIM data or in underlying JSDAI operations
Since:
3.6.0
See Also:
JSDAI Mapping Extension

assignMappedValue

public boolean assignMappedValue(SdaiContext context,
                                 jsdai.dictionary.EExplicit_attribute attribute,
                                 java.lang.Object attrValue,
                                 jsdai.dictionary.ANamed_type dataType)
                          throws SdaiException
Assigns (sets) value of mapped attribute.

Parameters:
context - The context of this operation. The following fields of SdaiContext have to be set: mappedWorkingModel
attribute - The attribute to assign value to
attrValue - The attribute value. This can be one of:
  • object corresponding simple type;
  • EEntity for entity instances;
  • either AEntity or Collection for aggregates
EEntity instances have to be target (AIM) instances
dataType - The data type aggregate which provides select path information. This parameter has to be not null only when the attribute domain is select and attribute value is of simple type of aggregate of simple types
Returns:
true is value was assigned to the attribute and false otherwise
Throws:
SdaiException - if an error occurs during attribute assignment from AIM data or in underlying JSDAI operations
Since:
3.6.0
See Also:
JSDAI Mapping Extension

applyMappedAttributes

public boolean applyMappedAttributes(SdaiContext context)
                              throws SdaiException
Applies mapped (AIM) attribute values to this ARM instance. This instance has to be in ATTRIBUTES_UNKNOWN state for AIM attribute values to be applied. An SdaiException is thrown if this instance is in ATTRIBUTES_MODIFIED state. If the instance is in ATTRIBUTES_UNMODIFIED state then no actions are taken.

Parameters:
context - The context of this operation. The following fields of SdaiContext have to be set: domain, mappingDomain, working_model, and mappedWorkingModel
Returns:
True is attribute value were applied and false if no actions were taken
Throws:
SdaiException - if an error occurs during attribute assignment from AIM data or in underlying JSDAI operations
See Also:
JSDAI Mapping Extension

getAttributeState

public int getAttributeState()
Returns this instance attribute state.

Returns:
the attribute state
See Also:
ATTRIBUTES_UNKNOWN, ATTRIBUTES_UNMODIFIED, ATTRIBUTES_MODIFIED

setAttributeState

public void setAttributeState(int attributeState)
Sets this instance attribute state. Changing the attribute state by calling this method can lead to unpredictable results therefore this method is primarily for internal use.

Parameters:
attributeState - the new instance attribute state
Since:
3.6.0
See Also:
ATTRIBUTES_UNKNOWN, ATTRIBUTES_UNMODIFIED, ATTRIBUTES_MODIFIED

getMappingTarget

public jsdai.dictionary.EEntity_definition getMappingTarget(SdaiContext context)
                                                     throws SdaiException
Returns the AIM entity type definition to which this instance maps.

Parameters:
context - The context of this operation. The following fields of SdaiContext have to be set: domain and mappingDomain,
Returns:
the AIM entity type definition
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
JSDAI Mapping Extension

unsetMappingTarget

public void unsetMappingTarget()
                        throws SdaiException
Unsets (clears) the AIM entity type definition to which this instance maps.

Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
JSDAI Mapping Extension

setMappingTarget

public void setMappingTarget(jsdai.dictionary.EEntity_definition edef)
                      throws SdaiException
Sets the AIM entity type definition to which this instance is supposed to map.

Parameters:
edef - the AIM entity type definition
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
JSDAI Mapping Extension

getAttributeMapping

public jsdai.mapping.EGeneric_attribute_mapping getAttributeMapping(jsdai.dictionary.EExplicit_attribute attr)
                                                             throws SdaiException
Returns the attribute mapping of an attribute. This is a helper method.

Parameters:
attr - explicit attribute definition to get the mapping for
Returns:
the generic mapping of the attribute
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
JSDAI Mapping Extension

findARMEntityMappings

public int findARMEntityMappings(SdaiContext context,
                                 jsdai.mapping.AEntity_mapping mappings,
                                 int mode)
                          throws SdaiException
Returns the entity_mappings alternatives for this instance type. This is a helper method.

Parameters:
context - The context of this operation. The following fields of SdaiContext have to be set: mappingDomain,
mappings - the output parameter, AEntity_mapping aggregate which receives found entity mappings.
mode - currently not used and should be equal to EEntity.NO_RESTRICTIONS
Returns:
the number of found entity mappings
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
JSDAI Mapping Extension

Copyright © LKSoftWare GmbH, 1999-2008