jsdai.lang
Class CMappedARMEntity

java.lang.Object
  extended byjsdai.lang.SdaiCommon
      extended byjsdai.lang.InverseEntity
          extended byjsdai.lang.CEntity
              extended byjsdai.lang.CMappedARMEntity
All Implemented Interfaces:
EEntity, EMappedARMEntity, SdaiEventSource

public abstract class CMappedARMEntity
extends CEntity
implements EMappedARMEntity

A common supertype of all ARM entity type implementing classes that support mapping operations. It is part of JSDAI implementation and is for internal JSDAI use.


Field Summary
 
Fields inherited from interface jsdai.lang.EMappedARMEntity
ATTRIBUTES_MODIFIED, ATTRIBUTES_UNKNOWN, ATTRIBUTES_UNMODIFIED
 
Fields inherited from interface jsdai.lang.EEntity
MANDATORY_ATTRIBUTES_SET, MOST_SPECIFC_ENTITY, NO_RESTRICTIONS
 
Method Summary
 void addAggregateItemSimple(EEntity parentInstance, jsdai.dictionary.EExplicit_attribute attribute, EEntity targetValue, boolean useIndexMask, int index)
          Adds items to an aggregate.
 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
static jsdai.dictionary.AAttribute getAllAttributes(jsdai.dictionary.EEntity_definition edef)
          Returns all attributes of the entity including supertype attributes.
 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 class jsdai.lang.CEntity
addSdaiListener, 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, getMappedAttribute, getMappedAttribute, getPersistentLabel, getTemp, getTemp, hasMappedAttribute, isInstanceOf, isInstanceOf, isKindOf, isKindOf, isValid, makeUsedin, moveUsersFrom, removeExternalData, removeSdaiListener, set, set, set, set, set, setTemp, setTemp, testAttribute, testAttributeFast, testExternalData, testMappedAttribute, testMappedAttribute, testMappedEntity, testMappedEntity, typeOf, toString, toValue, unsetAttributeValue, validateAggregatesSize, validateAggregatesUniqueness, validateArrayNotOptional, validateBinaryWidth, validateExplicitAttributesReferences, validateInverseAttributes, validateInverseAttributes, validateRealPrecision, validateRequiredExplicitAttributesAssigned, validateStringWidth, validateWhereRule, validateWhereRule
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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
 

Method Detail

setMappingTarget

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

Specified by:
setMappingTarget in interface EMappedARMEntity
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

unsetMappingTarget

public void unsetMappingTarget()
                        throws SdaiException
Description copied from interface: EMappedARMEntity
Unsets (clears) the AIM entity type definition to which this instance maps.

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

getMappingTarget

public jsdai.dictionary.EEntity_definition getMappingTarget(SdaiContext context)
                                                     throws SdaiException
Description copied from interface: EMappedARMEntity
Returns the AIM entity type definition to which this instance maps.

Specified by:
getMappingTarget in interface EMappedARMEntity
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

getAttributeState

public int getAttributeState()
Description copied from interface: EMappedARMEntity
Returns this instance attribute state.

Specified by:
getAttributeState in interface EMappedARMEntity
Returns:
the attribute state
See Also:
EMappedARMEntity.ATTRIBUTES_UNKNOWN, EMappedARMEntity.ATTRIBUTES_UNMODIFIED, EMappedARMEntity.ATTRIBUTES_MODIFIED

setAttributeState

public void setAttributeState(int attributeState)
Description copied from interface: EMappedARMEntity
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.

Specified by:
setAttributeState in interface EMappedARMEntity
Parameters:
attributeState - the new instance attribute state
Since:
3.6.0
See Also:
EMappedARMEntity.ATTRIBUTES_UNKNOWN, EMappedARMEntity.ATTRIBUTES_UNMODIFIED, EMappedARMEntity.ATTRIBUTES_MODIFIED

applyMappedAttributes

public boolean applyMappedAttributes(SdaiContext context)
                              throws SdaiException
Description copied from interface: EMappedARMEntity
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.

Specified by:
applyMappedAttributes in interface EMappedARMEntity
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

assignMappedValue

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

Specified by:
assignMappedValue in interface EMappedARMEntity
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
Description copied from interface: EMappedARMEntity
Assigns (sets) value of mapped attribute.

Specified by:
assignMappedValue in interface EMappedARMEntity
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

createAimData

public void createAimData(SdaiContext context)
                   throws SdaiException
Description copied from interface: EMappedARMEntity
Creates AIM data from ARM subpopulation starting from this ARM instance.

Specified by:
createAimData in interface EMappedARMEntity
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
Description copied from interface: EMappedARMEntity
Removes AIM data which corresponds this ARM instance. This method works like EEntity.deleteApplicationInstance() but works on AIM population and is mapping based.

Specified by:
removeAimData in interface EMappedARMEntity
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()
Description copied from interface: EMappedARMEntity
Returns the AIM instance which corresponds this ARM instance

Specified by:
getAimInstance in interface EMappedARMEntity
Returns:
The AIM instance or null if there is no AIM instance linked to this ARM instance.

setAimInstance

public void setAimInstance(EEntity aimInstance)
Description copied from interface: EMappedARMEntity
Sets AIM instance which corresponds this ARM instance. Invoking this methods establishes two directional link between ARM and AIM.

Specified by:
setAimInstance in interface EMappedARMEntity
Parameters:
aimInstance - The AIM instance to be linked to this ARM instance
See Also:
JSDAI Mapping Extension

getNextArmInstance

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

Specified by:
getNextArmInstance in interface EMappedARMEntity
Returns:
The next ARM instance or null if there is no more ARM instance linked to the same AIM instance.
Since:
3.6.0

addAggregateItemSimple

public void addAggregateItemSimple(EEntity parentInstance,
                                   jsdai.dictionary.EExplicit_attribute attribute,
                                   EEntity targetValue,
                                   boolean useIndexMask,
                                   int index)
                            throws SdaiException
Adds items to an aggregate. This method is intended for internal JSDAI use.

Parameters:
parentInstance - The entity instance
attribute - The attribute
targetValue - The value to add
useIndexMask - If true then index parameter is used as an index
index - The index of the member to add. Is used only when useIndexMask is true.
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations

getAttributeMapping

public jsdai.mapping.EGeneric_attribute_mapping getAttributeMapping(jsdai.dictionary.EExplicit_attribute attr)
                                                             throws SdaiException
Description copied from interface: EMappedARMEntity
Returns the attribute mapping of an attribute. This is a helper method.

Specified by:
getAttributeMapping in interface EMappedARMEntity
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
Description copied from interface: EMappedARMEntity
Returns the entity_mappings alternatives for this instance type. This is a helper method.

Specified by:
findARMEntityMappings in interface EMappedARMEntity
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

getAllAttributes

public static jsdai.dictionary.AAttribute getAllAttributes(jsdai.dictionary.EEntity_definition edef)
                                                    throws SdaiException
Returns all attributes of the entity including supertype attributes. This method is intended for internal JSDAI use.

Parameters:
edef - The entity type definition
Returns:
AAttribute containing all attribute definitions
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations

Copyright © LKSoftWare GmbH, 1999-2008