|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Implicit supertype for all dictionary and application entity types.
AEntity
,
jsdai.dictionary.EEntity_definition,
"ISO 10303-22::9.4.2 entity_instance",
"ISO 10303-22::9.4.3 application_instance",
"ISO 10303-22::9.4.5 dictionary_instance"Field Summary | |
static int |
MANDATORY_ATTRIBUTES_SET
Tn addition to MOST_SPECIFIC_ENTITY it also requires, that all explicit mandatory attributes are set. |
static int |
MOST_SPECIFC_ENTITY
The mode to return only mapping of the most specific and not abstract entities. |
static int |
NO_RESTRICTIONS
The mode to apply no additional restrictions on the data returned by findEntityMappings ,
getMappedAttribute ,
getMappedAttribute , |
Method Summary | |
EMappedARMEntity |
buildMappedInstance(SdaiContext context,
jsdai.dictionary.EEntity_definition mappedInstanceType)
Creates or returns already created mapped entity instance in context's mappedWorkingModel model. |
boolean |
compareValuesBoolean(EEntity inst)
Compares this entity instance to the submitted entity instance. |
int |
compareValuesLogical(EEntity instance)
Compares this entity instance to the submitted entity instance. |
EEntity |
copyApplicationInstance(SdaiModel target_model)
Creates a copy of this instance in the specified SdaiModel .
|
EEntity |
copyValuesFrom(EEntity src)
Copies values of all attributes of the entity instance submitted through the parameter to the corresponding attributes of the current entity instance. |
Aggregate |
createAggregate(jsdai.dictionary.EAttribute attribute,
jsdai.dictionary.EDefined_type[] select)
Creates a new empty aggregate instance replacing the existing value (if any) of the specified explicit attribute. |
ExternalData |
createExternalData()
Creates external for this entity. |
void |
deleteApplicationInstance()
Deletes this entity instance. |
SdaiModel |
findEntityInstanceSdaiModel()
Returns SdaiModel this entity instance belongs to. |
void |
findEntityInstanceUsedin(jsdai.dictionary.EAttribute role,
ASdaiModel domain,
AEntity result)
Searches for entity instances which reference the current instance in the role specified by an instance of EAttribute (first parameter). |
void |
findEntityInstanceUsers(ASdaiModel domain,
AEntity result)
Searches for entity instances which reference the current instance. |
int |
findEntityMappings(ASdaiModel dataDomain,
ASdaiModel mappingDomain,
jsdai.mapping.AEntity_mapping mappings,
int mode)
Finds entity_mappings that fit with this instance. |
int |
findEntityMappings(jsdai.dictionary.EEntity_definition sourceEntity,
ASdaiModel dataDomain,
ASdaiModel mappingDomain,
jsdai.mapping.AEntity_mapping mappings,
int mode)
Finds entity_mappings that fit with this instance. |
void |
findInstanceDataTypes(jsdai.dictionary.ANamed_type result,
jsdai.dictionary.ESchema_definition schema)
This method is not implemented in current JSDAI version. |
void |
findInstanceRoles(ASdaiModel domain,
jsdai.dictionary.AAttribute result)
Searches for attributes by which other entity instances reference the current instance. |
EMappedARMEntity |
findLinkedMappedInstance(jsdai.dictionary.EEntity_definition mappedInstanceType)
Finds already created mapped entity instance. |
AEntity |
findMappedUsers(jsdai.mapping.EEntity_mapping source_type,
jsdai.mapping.AAttribute_mapping attribute,
ASdaiModel data_domain,
ASdaiModel mapping_domain,
jsdai.mapping.AAttribute_mapping users,
int mode)
It finds application data instances that coresponds to mapped instaces, that references to this instance. |
jsdai.mapping.AEntity_mapping |
findMostSpecificMappings(ASdaiModel dataDomain,
ASdaiModel mappingDomain,
jsdai.mapping.AEntity_mapping baseMappings,
int mode)
Finds most specific ARM mappings for the instance. |
boolean |
get_boolean(jsdai.dictionary.EAttribute attribute)
Returns the value (of type boolean) of the specified attribute. |
double |
get_double(jsdai.dictionary.EAttribute attribute)
Returns the value (of type double) of the specified attribute. |
int |
get_int(jsdai.dictionary.EAttribute attribute)
Returns the value (of type int) of the specified attribute. |
AEntity |
get_inverse(jsdai.dictionary.EInverse_attribute attribute,
ASdaiModel domain)
Returns the value (of type aggregate of entities) of the specified inverse attribute. |
java.lang.Object |
get_object(jsdai.dictionary.EAttribute attribute)
Returns the value (of type Object) of the specified attribute. |
Value |
get(jsdai.dictionary.EAttribute attribute)
Returns the value (wrapped in an object of type Value ) of the
specified attribute, which can be either explicit or derived but not inverse.
|
AEntity |
getAllReferences()
Returns an aggregate (of Express type LIST) whose elements are entity instances referenced by the current entity instance. |
jsdai.dictionary.EAttribute |
getAttributeDefinition(java.lang.String attributeName)
Returns a specific instance of the entity "attribute" defined in "SDAI_dictionary_schema", describing EXPRESS schemas on the meta level. |
int |
getAttributeValueBound(jsdai.dictionary.EAttribute attribute)
This method is not implemented in current JSDAI version. |
java.lang.String |
getDescription()
Returns a human readable description of the entity instance. |
ExternalData |
getExternalData()
Gets external data object. |
jsdai.dictionary.EEntity_definition |
getInstanceType()
Returns the instance of EEntity_definition which represents
the type of this entity instance in "SDAI_dictionary_schema".
|
java.lang.Object[] |
getMappedAttribute(jsdai.dictionary.EAttribute sourceAttribute,
ASdaiModel dataDomain,
ASdaiModel mappingDomain,
int mode)
Returns value for source attribute. |
java.lang.Object |
getMappedAttribute(jsdai.mapping.EGeneric_attribute_mapping sourceAttribute,
ASdaiModel dataDomain,
ASdaiModel mappingDomain,
int mode)
Returns value of attribute following constraints defined by attribute_mapping. |
java.lang.String |
getPersistentLabel()
Returns a String , which is a persistent label of this entity instance.
|
java.lang.Object |
getTemp()
Returns an Object where an application is allowed
to store some user's data related to this entity instance.
|
java.lang.Object |
getTemp(java.lang.Object key)
An extension of getTemp() . |
boolean |
hasMappedAttribute(jsdai.mapping.EEntity_mapping entityMapping,
jsdai.dictionary.EAttribute attribute,
ASdaiModel mappingDomain)
Checks is attribute mapped for given entity mapping. |
boolean |
isInstanceOf(java.lang.Class type)
Checks if java.lang.Class object of this entity instance
coincides with the given java.lang.Class object which describes java class
representing some other entity instance. |
boolean |
isInstanceOf(jsdai.dictionary.EEntity_definition type)
Checks if the type (described by EEntity_definition) of this entity instance coincides with the type given by method's parameter. |
boolean |
isKindOf(java.lang.Class type)
Checks if java.lang.Class object of this entity instance
coincides with the given java.lang.Class object, which describes java class
representing some other entity instance, or is a java.lang.Class object for
the java class which is a subclass of the given class. |
boolean |
isKindOf(jsdai.dictionary.EEntity_definition type)
Checks if the type (described by EEntity_definition) of this entity instance coincides with the given type (instance of EEntity_definition) or is a subtype of it. |
boolean |
isValid()
Checks if java Object of type EEntity
represents a valid instance of a population within SdaiSession . |
EEntity |
moveUsersFrom(EEntity src)
Changes all the pointers referencing an entity instance submitted through the parameter to the pointers referencing the current entity instance. |
void |
removeExternalData()
Removes external data which was attached to this entity. |
void |
set(jsdai.dictionary.EAttribute attribute,
boolean value,
jsdai.dictionary.EDefined_type[] select)
Assigns a value of type boolean to the specified explicit attribute.
|
void |
set(jsdai.dictionary.EAttribute attribute,
double value,
jsdai.dictionary.EDefined_type[] select)
Assigns a value of type double to the specified explicit attribute.
|
void |
set(jsdai.dictionary.EAttribute attribute,
int value,
jsdai.dictionary.EDefined_type[] select)
Assigns a value of type int to the specified explicit attribute.
|
void |
set(jsdai.dictionary.EAttribute attribute,
java.lang.Object value,
jsdai.dictionary.EDefined_type[] select)
Assigns a value of type Object to the specified explicit attribute.
|
void |
set(jsdai.dictionary.EExplicit_attribute attribute,
Value val)
Assigns the value wrapped in a given object of type Value
to the specified explicit attribute. |
void |
setTemp(java.lang.Object value)
Assigns a value to special field of type Object
in which an application is allowed to store some user's data related
to this entity instance.
|
void |
setTemp(java.lang.Object key,
java.lang.Object value)
An extension of setTemp(Object value) . |
int |
testAttribute(jsdai.dictionary.EAttribute attribute,
jsdai.dictionary.EDefined_type[] select)
Checks if the specified attribute has a value and if so, then returns an indicator showing the type of the value. |
boolean |
testExternalData()
Tests if external data is attached to this entity. |
jsdai.mapping.AGeneric_attribute_mapping |
testMappedAttribute(jsdai.dictionary.EAttribute sourceAttribute,
ASdaiModel dataDomain,
ASdaiModel mappingDomain,
int mode)
Tests mapping of source attribute. |
boolean |
testMappedAttribute(jsdai.mapping.EGeneric_attribute_mapping sourceAttribute,
ASdaiModel dataDomain,
ASdaiModel mappingDomain,
int mode)
Test whether this target instance does fit to the constraints of the given attribute_mapping. |
jsdai.mapping.AEntity_mapping |
testMappedEntity(jsdai.dictionary.EEntity_definition sourceEntity,
ASdaiModel dataDomain,
ASdaiModel mappingDomain,
int mode)
Tests whether this instance of a target entity type does fit to mapping constraints of specified source entity. |
boolean |
testMappedEntity(jsdai.mapping.EEntity_mapping sourceEntity,
ASdaiModel dataDomain,
ASdaiModel mappingDomain,
int mode)
Tests whether this instance of a target entity type does fit to mapping constraints of specified source entity. |
jsdai.dictionary.AEntity_definition |
typeOf()
Returns an aggregate containing definitions of all single entity data types from which the entity type of this instance consists. |
java.lang.String |
toString()
Returns a String representing this entity instance
including values of all its attributes.
|
void |
unsetAttributeValue(jsdai.dictionary.EAttribute attribute)
Changes the state of the specified explicit attribute, so that this attribute has no value longer. |
int |
validateAggregatesSize(jsdai.dictionary.AAttribute nonConf)
Checks if the number of members in aggregates, or valid index values for array instances, of any attributes of this entity instance meet the constraints specified in the types of these attributes. |
boolean |
validateAggregatesUniqueness(jsdai.dictionary.AAttribute nonConf)
Checks if all members are unique in any aggregate instance being a value of any attribute whose type requires uniqueness. |
boolean |
validateArrayNotOptional(jsdai.dictionary.AAttribute nonConf)
Checks if arrays have values at all positions for the attributes of this entity instance where optional elements are not allowed. |
int |
validateBinaryWidth(jsdai.dictionary.AAttribute nonConf)
Checks if Binary values assigned to attributes of this entity instance
are of the required width.
|
int |
validateExplicitAttributesReferences(jsdai.dictionary.AAttribute nonConf)
Checks if all the entity instances referenced by explicit attributes of this entity instance are of valid type for those attributes. |
boolean |
validateInverseAttributes(jsdai.dictionary.AAttribute nonConf)
Checks if cardinality constraints specified in the INVERSE clauses are satisfied for this entity instance. |
boolean |
validateInverseAttributes(jsdai.dictionary.AAttribute nonConf,
ASdaiModel domain)
Checks if cardinality constraints specified in the INVERSE clauses are satisfied for this entity instance. |
int |
validateRealPrecision(jsdai.dictionary.AAttribute nonConf)
Checks if real values assigned to attributes of this entity instance
are of the required minimum precision.
|
boolean |
validateRequiredExplicitAttributesAssigned(jsdai.dictionary.AAttribute nonConf)
Checks if all non-optional explicit attributes of this instance have values. |
int |
validateStringWidth(jsdai.dictionary.AAttribute nonConf)
Checks if strings assigned, either directly or as members of aggregates, to attributes of this entity instance are of the required width. |
int |
validateWhereRule(jsdai.dictionary.AWhere_rule viol_rules,
ASdaiModel domain)
Checks if where rules associated with this instance are satisfied. |
int |
validateWhereRule(jsdai.dictionary.EWhere_rule rule,
ASdaiModel domain)
Checks if a where rule is satisfied for this instance. |
Methods inherited from interface jsdai.lang.SdaiEventSource |
addSdaiListener, removeSdaiListener |
Field Detail |
public static final int NO_RESTRICTIONS
findEntityMappings
,
getMappedAttribute
,
getMappedAttribute
,
public static final int MOST_SPECIFC_ENTITY
findEntityMappings
.
public static final int MANDATORY_ATTRIBUTES_SET
Method Detail |
public java.lang.Object get_object(jsdai.dictionary.EAttribute attribute) throws SdaiException
All the early-binding and late-binding methods implementing "Get Attribute" operation behave as follows. In the case when the value of the attribute is unset, SdaiException VA_NSET is thrown. If in the express specification the attribute is defined as OPTIONAL, the user should first invoke the testAttribute method to check whether the attribute is set (has value) and only after this invoke appropriate method implementing "Get Attribute" operation. In the case when in the express the attribute is not defined to be OPTIONAL, the user can directly apply one of such methods. Thus, SdaiException VA_NSET is thrown only in the case when population of instances is invalid. This leads to application programs with a clear structure.
In the case when the attribute is of EEntity type, the behaviour of the methods implementing "Get Attribute" depends on which SdaiModel and SdaiRepository the referenced instance belongs to. If the SdaiModel of the instance is already in read-only or read-write access mode, e.g. because this instance and the referencing one are in the same SdaiModel, then the instance is returned immediately. If the SdaiModel has access mode unset, but belongs to an open SdaiRepository, then first the read-only access for this model is started and only then the instance is returned. If, however, the SdaiRepository is closed, SdaiException RP_NOPN is thrown.
The method throws SdaiException FN_NAVL if attribute whose value is asked
is inverse or derived. In the former case, get_inverse
method shall be used.
Example:
EVector vect = ...;
EAttribute attr = vect.getAttributeDefinition("orientation");
// access the attribute as a general entity, that is, EEntity
EEntity inst = (EEntity)vect.get_object(attr);
// access the attribute as a specific entity
EDirection dir = (EDirection)vect.get_object(attr);
attr = vect.getAttributeDefinition("name");
// access a String attribute
String name = (String)vect.get_object(attr);
attribute
- the attribute which value is needed.
SdaiException
- RP_NOPN, repository is not open.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- VA_NSET, value not set.
SdaiException
- FN_NAVL, function not available.
SdaiException
- SY_ERR, underlying system error.get_int
,
get_double
,
get_boolean
,
get_inverse
,
getAttributeDefinition
,
testAttribute
,
"10303-22::10.10.1 Get attribute"public int get_int(jsdai.dictionary.EAttribute attribute) throws SdaiException
The method throws SdaiException AT_NVLD if the passed
attribute is not from this entity, SdaiException VT_NVLD if the attribute
type is different than integer, and SdaiException FN_NAVL if attribute
whose value is asked is a derived one.
For more details see method get_object
.
Example:
ACalendar_date date_list = ...;
ECalendar_date date = date_list.getByIndex(1);
EAttribute attr = date.getAttributeDefinition("year_component");
int year = date.get_int(attr);
attribute
- the attribute which value is needed.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- VA_NSET, value not set.
SdaiException
- FN_NAVL, function not available.
SdaiException
- SY_ERR, underlying system error.get_object
,
get_double
,
get_boolean
,
getAttributeDefinition
,
testAttribute
,
"ISO 10303-22::10.10.1 Get attribute"public boolean get_boolean(jsdai.dictionary.EAttribute attribute) throws SdaiException
The method throws SdaiException AT_NVLD if the passed
attribute is not from this entity, SdaiException VT_NVLD if the attribute
type is different than boolean, and SdaiException FN_NAVL if attribute
whose value is asked is a derived one.
For more details see method get_object
.
Example:
ETrimmed_curve curve = ...;
EAttribute attr = curve.getAttributeDefinition("sense_agreement");
boolean agreement = curve.get_boolean(attr);
attribute
- the attribute which value is needed.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- VA_NSET, value not set.
SdaiException
- FN_NAVL, function not available.
SdaiException
- SY_ERR, underlying system error.get_object
,
get_int
,
get_double
,
getAttributeDefinition
,
testAttribute
,
"ISO 10303-22::10.10.1 Get attribute"public double get_double(jsdai.dictionary.EAttribute attribute) throws SdaiException
The method throws SdaiException AT_NVLD if the passed
attribute is not from this entity, SdaiException VT_NVLD if the attribute
type is different than double, and SdaiException FN_NAVL if attribute
whose value is asked is a derived one.
For more details see method get_object
.
Example:
Vector vector_list = ...;
EVector vect = vector_list.getByIndex(1);
EAttribute attr = vect.getAttributeDefinition("magnitude");
double magn = vect.get_double(attr);
attribute
- the attribute which value is needed.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- VA_NSET, value not set.
SdaiException
- FN_NAVL, function not available.
SdaiException
- SY_ERR, underlying system error.get_object
,
get_int
,
get_boolean
,
getAttributeDefinition
,
testAttribute
,
"ISO 10303-22::10.10.1 Get attribute"public AEntity get_inverse(jsdai.dictionary.EInverse_attribute attribute, ASdaiModel domain) throws SdaiException
SdaiModel
s
which belong to the set given by the second parameter.
In the case when the second parameter is null, the search is restricted
to the model which is the owner of the current instance (can be found
using findEntityInstanceSdaiModel
).
The method throws SdaiException AT_NVLD if the passed attribute is either not inverse one or not from this entity.
Example:
EComposite_curve_segment segment = ...;
ASdaiModel domain = ...;
EInverse_attribute inv_attr = (EInverse_attribute)segment.getAttributeDefinition("using_curves");
AEntity inv_aggr = segment.get_inverse(inv_attr, domain);
attribute
- the inverse attribute which value is needed.domain
- the list of SdaiModel
s that defines the
area where to search for entity instances referencing the current
entity instance in the way specified by the given inverse attribute.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- SY_ERR, underlying system error.get_object
,
get_int
,
get_double
,
get_boolean
,
getAttributeDefinition
,
"10303-22::10.10.1 Get attribute"public int testAttribute(jsdai.dictionary.EAttribute attribute, jsdai.dictionary.EDefined_type[] select) throws SdaiException
testAttribute
,
Aggregate.testByIndex
and
Aggregate.testCurrentMember
returns the same type indicator.
Example 1 showing how to use testAttribute as a late binding operation:
EDefined_type [] selection = new EDefined_type[3];
EAttribute attr = ...;
EEntity instance= ...;
int type = instance.testAttribute(attr, selection);
switch (type) {
case 0: // unset
// skip
break;
case 1: // object
Object oValue = instance.get_object(attr);
if (oValue instanceof EEntity) {
...
} else if (oValue instanceof Aggregate) {
...
} else if (oValue instanceof String) {
...
}
break;
case 2: // integer
int iValue = instance.get_int(attr);
break;
case 3: // double
double rValue = instance.get_double(attr);
EDefined_type areaMeasureType = ...;
EDefined_type lengthMeasureType = ...;
if (selection(0) == areaMeasureType) {
double area = rValue;
} else if (selection(0) == lengthMeasureType) {
double length = rValue;
break;
case 4: // boolean
boolean bValue = instance.get_boolean(attr);
break;
}
Example 2 illustrating early binding usage of the "Test Attribute" operation:
EMeasure_with_unit instance = ...;
int iSelection = instance.testValue_component(null);
switch (iSelection) {
case EMeasure_with_unit.sValue_componentArea_measure:
double area = instance.getValue_component((EArea_measure) null);
break;
case EMeasure_with_unit.sValue_componentLength_measure:
double length = instance.getValue_component((ELength_measure) null);
break;
...;
}
attribute
- the attribute which value is tested.select
- the array of defined types used to store the select path
corresponding to the actual value of the attribute.
SdaiException
- RP_NOPN, repository is not open.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- SY_ERR, underlying system error.get_object
,
get_int
,
get_double
,
get_boolean
,
getAttributeDefinition
,
"ISO 10303-22::10.10.2 Test attribute"public jsdai.dictionary.EAttribute getAttributeDefinition(java.lang.String attributeName) throws SdaiException
This method is an extension of JSDAI, which is not a part of the standard.
Example:
EVector vect = ...;
EAttribute attr = vect.getAttributeDefinition("magnitude");
attributeName
- the name of the entity attribute, possibly, with the simple entity name as a prefix.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- SY_ERR, underlying system error.get_object
,
get_int
,
get_double
,
get_boolean
,
get_inverse
,
findEntityInstanceUsedin
,
getAttributeValueBound
,
set
,
unsetAttributeValue
,
createAggregate
public SdaiModel findEntityInstanceSdaiModel() throws SdaiException
SdaiModel
this entity instance belongs to. Every entity instance
does belong to exactly one SdaiModel
. The entity instances of an SdaiModel
are only available when this model is either in read-only or read-write access mode.
If the access mode is unset, all the entity instances of this SdaiModel
become forbidden for the applications. In fact, invocation of most methods
for such an instance causes SdaiException EI_NEXS to be thrown.
Don't be irritated by the word "find" in the name of the method. This method is fast because JSDAI has this information available explicitly.
Example:
EEntity inst = ...;
SdaiModel owner = inst.findEntityInstanceSdaiModel();
SdaiModel
that contains this entity instance.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.public jsdai.dictionary.EEntity_definition getInstanceType() throws SdaiException
EEntity_definition
which represents
the type of this entity instance in "SDAI_dictionary_schema".
Example:
EEntity inst = ...;
EEntity_definition def = inst.getInstanceType();
SdaiException
public boolean isInstanceOf(jsdai.dictionary.EEntity_definition type) throws SdaiException
isInstanceOf(Class)
, solely on the
basis of "SDAI_dictionary_schema" information.
If null is passed to the method's parameter,
then SdaiException ED_NDEF is thrown.
Example:
EEntity inst = ...;
EEntity another_inst = ...;
EEntity_definition def = another_inst.getInstanceType();
boolean is_of_def = inst.isInstanceOf(def);
type
- the given type (instance of EEntity_definition).
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- ED_NDEF, entity definition not defined.
SdaiException
- SY_ERR, underlying system error.isInstanceOf(Class)
,
isKindOf(EEntity_definition)
,
isKindOf(Class)
,
"ISO 10303-22::10.10.5 Is instance of"public boolean isInstanceOf(java.lang.Class type) throws SdaiException
java.lang.Class
object of this entity instance
coincides with the given java.lang.Class
object which describes java class
representing some other entity instance. Contrary to
isInstanceOf(EEntity_definition)
method,
no "SDAI_dictionary_schema" information is used.
Example:
EEntity inst = ...;
EEntity another_inst = ...;
Class cl = another_inst.getClass();
boolean is_of_cl = inst.isInstanceOf(cl);
type
- java.lang.Class
object which describes java class
representing some entity instance.
java.lang.Class
object of this entity instance coincides
with the given java.lang.Class
object; false, otherwise.
SdaiException
- EI_NEXS, entity instance does not exist.isInstanceOf(EEntity_definition)
,
isKindOf(EEntity_definition)
,
isKindOf(Class)
,
"ISO 10303-22::10.10.5 Is instance of"public boolean isKindOf(jsdai.dictionary.EEntity_definition type) throws SdaiException
isKindOf(Class)
method, solely on the
basis of "SDAI_dictionary_schema" information.
If null is passed to the method's parameter,
then SdaiException ED_NDEF is thrown.
Example:
EVector vect = ...;
ERepresentation_item item = ...;
EEntity_definition def = item.getInstanceType();
boolean is_vect_an_item = vect.isKindOf(def);
type
- the given type (instance of EEntity_definition).
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- ED_NDEF, entity definition not defined.isInstanceOf(EEntity_definition)
,
isInstanceOf(Class)
,
isKindOf(Class)
,
"ISO 10303-22::10.10.6 Is kind of"public boolean isKindOf(java.lang.Class type) throws SdaiException
java.lang.Class
object of this entity instance
coincides with the given java.lang.Class
object, which describes java class
representing some other entity instance, or is a java.lang.Class
object for
the java class which is a subclass of the given class. Contrary to
isKindOf(EEntity_definition)
method,
no "SDAI_dictionary_schema" information is used.
If null value is passed to the method's
parameter, then SdaiException VA_NSET is thrown.
Example:
EVector vect = ...;
boolean is_vect_an_item = vect.isKindOf(ERepresentation_item.class);
type
- java.lang.Class
object which describes java class
representing some entity instance.
java.lang.Class
object of this entity instance coincides
with the given java.lang.Class
object or is a java.lang.Class
object for
the java class which is a subclass of the given class; false, otherwise.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- VA_NSET, value not set.
SdaiException
- SY_ERR, underlying system error.isInstanceOf(EEntity_definition)
,
isInstanceOf(Class)
,
isKindOf(EEntity_definition)
,
"ISO 10303-22::10.10.6 Is kind of"public void findEntityInstanceUsers(ASdaiModel domain, AEntity result) throws SdaiException
SdaiModel
s
which belong to the set given by the first method's parameter.
In the case when the first parameter is null, the search is restricted
to the model which is the owner of the current instance (can be found
using findEntityInstanceSdaiModel
).
If the value of the first parameter is an empty array of type ASdaiModel
,
then no restriction is imposed on the search area, that is, referencing
instances from all SdaiModel
s, which have either read-only or read-write
access, are considered as being relevant.
Referencing instances are stored into a non-persistent list passed
to the method through the second parameter. Usually this
list is created with operator new. A referencing instance is put into
this list as many times as it references the current instance.
If null value is passed to the method's second
parameter, then SdaiException AI_NEXS is thrown.
Example:
EProduct pro = ...;
EDirection dir = ...;
AEntity general_list = new AEntity();
pro.findEntityInstanceUsers(null, general_list);
ASdaiModel domain = ...;
ADirection dir_list = new ADirection();
dir.findEntityInstanceUsers(domain, dir_list);
domain
- the list of SdaiModel
s specifying the
area where to search for entity instances referencing the current
entity instance.result
- the submitted non-persistent list to which all entity
instances referencing this instance are appended.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- SY_ERR, underlying system error.findEntityInstanceUsedin
,
findInstanceRoles
,
"ISO 10303-22::10.10.8 Find entity instance users"public void findEntityInstanceUsedin(jsdai.dictionary.EAttribute role, ASdaiModel domain, AEntity result) throws SdaiException
SdaiModel
s
which belong to the set given by the second method's parameter.
In the case when the second parameter is null, the search is restricted
to the model which is the owner of the current instance (can be found
using findEntityInstanceSdaiModel
method).
If the value of the second parameter is an empty array of type ASdaiModel
,
then no restriction is imposed on the search area, that is, referencing
instances from all SdaiModel
s, which have either read-only or read-write
access, are considered as being relevant.
Referencing instances are stored into a non-persistent list submitted
to the method through the third parameter. Usually this
list is created with operator new. A referencing instance is put into
this list as many times as it references the current instance
in the specified role.
The list of cases when SdaiException
is thrown contains the following items:
In EXPRESS, a relation between two entities is defined and stored in only one entity of the pair, but it always exists in both directions. For some attributes of one entity, an inverse attribute on the other entity is defined. This is usually done to restrict the cardinality of the relation. But independently of the explicit specification of an inverse attribute there is an implicit inverse relation for every explicit one. The current JSDAI implementation of findEntityInstanceUsedin allows fast access to every inverse attribute. This method is fast because JSDAI explicitly stores all inverse pointers.
Example 1 illustrating late binding alternative:
EProduct product = ...;
EAttribute attrib = CProduct_definition_formation.attributeOf_product(null);
AProduct_definition_formation formations = new AProduct_definition_formation();
product.findEntityInstanceUsedin(attrib, null, formations);
Example 2 illustrating early binding alternative:
EProduct product = ...;
AProduct_definition_formation formations = new AProduct_definition_formation();
CProduct_definition_formation.usedinOf_product(null, product, null, formations);
role
- the attribute by which this entity instance is accessed.
Note that any attribute always belongs to exactly one entity definition.domain
- the list of SdaiModel
s specifying the
area where to search for entity instances referencing the current
entity instance in the specified role.result
- the submitted non-persistent list to which all entity
instances referencing this instance in the specified role (first parameter)
are appended.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- AI_NVLD, aggregate instance invalid.
SdaiException
- SY_ERR, underlying system error.findEntityInstanceUsers
,
findInstanceRoles
,
"ISO 10303-22::10.10.9 Find entity instance usedin"public int getAttributeValueBound(jsdai.dictionary.EAttribute attribute) throws SdaiException
SdaiException FN_NAVL will be thrown if this method is invoked.
attribute
- the attribute for which value bound is to be computed.
SdaiException
- FN_NAVL, function not available.public void findInstanceRoles(ASdaiModel domain, jsdai.dictionary.AAttribute result) throws SdaiException
SdaiModel
s
which belong to the set given by the first method's parameter.
In the case when the first parameter is null, the search is restricted
to the model which is the owner of the current instance (can be found
using findEntityInstanceSdaiModel
method).
Referencing attributes are stored into a non-persistent list submitted
to the method through the second parameter. Usually this
list is created with operator new.
If null value is passed to the method's second
parameter, then SdaiException AI_NEXS is thrown.
This method bears some similarity to findEntityInstanceUsers
method. However, the result is not the referencing instances but
the list containing entity attributes by which the current instance
from other instances is referenced. Each attribute is represented
by an instance of the class CAttribute
of the SDAI dictionary.
Having an instance of CAttribute
it is possible to get
entity definition containing it by simply applying
getParent_entity
method.
Example:
EProduct pro = ...;
EDirection dir = ...;
AEntity general_list = new AEntity();
pro.findInstanceRoles(null, general_list);
ASdaiModel domain = ...;
ADirection dir_list = new ADirection();
dir.findInstanceRoles(domain, dir_list);
domain
- the list of SdaiModel
s specifying the
area where to search for attributes by which other entity instances
reference the current instance.result
- the submitted non-persistent list to which all
attributes that reference this entity instance are appended.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- SY_ERR, underlying system error.findEntityInstanceUsers
,
findEntityInstanceUsedin
,
"ISO 10303-22::10.10.11 Find instance roles"public void findInstanceDataTypes(jsdai.dictionary.ANamed_type result, jsdai.dictionary.ESchema_definition schema) throws SdaiException
SdaiException FN_NAVL will be thrown if this method is invoked.
result
- the submitted non-persistent list to which all
named types of which this entity instance is a member are appended.schema
- defines the scope where to search for the named types
for which this instance is a member of. If the value is null
, then
the underlying schema of the model to which this instance belongs is taken.
SdaiException
- FN_NAVL, function not available.public EEntity copyApplicationInstance(SdaiModel target_model) throws SdaiException
SdaiModel
.
All attribute values from this instance are copied to the new one.
If some attribute is of aggregation type, then in the new instance
for this attribute a new aggregate is created and either filled
with values taken from this instance (if the aggregation type
describes non-nested aggregate) or this rule is applied recursively
(if the aggregation type describes nested aggregate).
If this and new instances belong to the same repository,
then persistent labels for these instances will be different.
A target SdaiModel
to which the current instance is copied
must be in read-write access mode. If, however, no target model is submitted
to the method (through its parameter), then SdaiException
MO_NEXS is thrown.
This method is applicable to instances of entities which are encountered
in the EXPRESS schema whose definition is underlying for the target model.
Otherwise, that is, if entity is not known for this schema,
SdaiException
ED_NVLD is thrown.
target_model
- the SdaiModel
this application instance to be copied to.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- MO_NEXS, SDAI-model does not exist.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- ED_NVLD, entity definition invalid.
SdaiException
- SY_ERR, underlying system error.public void deleteApplicationInstance() throws SdaiException
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- SY_ERR, underlying system error.public void set(jsdai.dictionary.EAttribute attribute, java.lang.Object value, jsdai.dictionary.EDefined_type[] select) throws SdaiException
Object
to the specified explicit attribute.
This method is applicable for values of type EEntity, String, and Binary.
If the base type of the attribute is select type and the set of possible
leaf types is not a subset of the set of entity data types,
then the select path corresponding to the value to be assigned needs to be
submitted (through the third method's parameter).
Otherwise, null to the third parameter can be passed.
Select path is a sequence of defined data types needed to specify a value of a select data type (as defined in ISO 10303-21:11.1.8). In fact, for a select data type a value of which is asked to be set, a certain oriented acyclic graph G = (V,A) can be constructed. The vertices of this graph correspond to defined data types and select data types. An arc goes from the vertex representing defined data type to a vertex representing select data type if the latter is the value of the attribute "domain" of the former. Further, an arc connects vertex of the select data type to a vertex of the defined data type if this latter type belongs to the SET assigned to the attribute "selections" of the select data type.
Example. Suppose the following data types are given (here Express language notation is used):
TYPE chi = LIST [1:3] OF REAL;
END_TYPE;
TYPE xi = INTEGER;
END_TYPE;
TYPE tau = ENUMERATION OF
(stigma,
digamma,
koppa,
sampi);
END_TYPE;
TYPE rho = SELECT
(nu,
omicron,
upsilon);
END_TYPE;
TYPE nu = SELECT
(chi,
xi,
tau);
END_TYPE;
TYPE omicron = lambda;
END_TYPE;
TYPE lambda = nu;
END_TYPE;
TYPE upsilon = SET [0:3] OF nu;
END_TYPE;
For these Express definitions the following data dictionary instances are created by JSDAI:
#2=DEFINED_TYPE('chi',(),$,#94);
#94=LIST_TYPE(#93,#91,#92,.F.);
#91=INTEGER_BOUND(1);
#92=INTEGER_BOUND(3);
#93=REAL_TYPE($);
#10=DEFINED_TYPE('xi',(),$,#99);
#99=INTEGER_TYPE();
#16=DEFINED_TYPE('tau',(),$,#103);
#103=ENUMERATION_TYPE(('stigma','digamma','koppa','sampi'));
#20=DEFINED_TYPE('rho',(),$,#105);
#105=SELECT_TYPE((#4,#14,#18));
#4=DEFINED_TYPE('nu',(),$,#104);
#104=SELECT_TYPE((#2,#10,#16));
#14=DEFINED_TYPE('omicron',(),$,#15);
#15=DEFINED_TYPE('lambda',(),$,#4);
#18=DEFINED_TYPE('upsilon',(),$,#102);
#102=SET_TYPE(#4,#100,#92);
#100=INTEGER_BOUND(0);
Then, for example, for the select data type "rho" the oriented graph G can be constructed
whose vertex set V = {#20,#105,#4,#14,#18,#104,#15,#2,#10,#16}
and the arc set A = {(#20,#105), (#105,#4), (#105,#14), (#105,#18), (#4,#104),
(#14,#15), (#15,#4), (#104,#2), (#104,#10), (#104,#16)}.
The root of the graph corresponds to the select data type inducing the graph, whereas the types of the values which can be assigned to an attribute of this select data type are represented by the vertices of this graph having no outcoming arcs (leaves of the graph). These vertices are called value vertices. In the example given above, the root #20 is for "rho" and the vertices #2,#10,#16,#18 represent 'LIST [1:3] OF REAL', INTEGER, 'ENUMERATION OF (stigma,digamma,koppa,sampi)', and 'SET [0:3] OF nu', respectively. When setting a value to an attribute, the needed path from the root of the graph to one of its value vertices shall be identified. To unambiguously describe such a path, it is sufficient to list only vertices of G corresponding to defined data types. Even more, not all such vertices following from the root to a value vertex are taken. The following two rules shall be applied:
Example (continued). For value of type 'SET [0:3] OF nu' the full path is #20,#105,#18, whereas the corresponding shrinked select path is #18, that is, consists of a single vertex. For value of type INTEGER there is full path #20,#105,#4,#104,#10 and its shrinked select path is #10. However, for INTEGER there exists also another path #20,#105,#14,#15,#4,#104,#10. Its shrinked select path is #14,#10. This means that the same integer value can be set to the same attribute in two slightly different contexts.
When trying to set a value for a given attribute whose base type is select
data type and in the graph describing it there is the corresponding value vertex,
then it is required to provide the shrinked select path to this value vertex by
submitting a nonempty array of EDefined_type as the third parameter of this method.
To prepare this array, getDefinedType
method can be used.
Example (continued). To set an integer to an attribute of type "rho" the following statements can be adopted.
EEpsilon inst = ...
EAttribute attr = inst.getAttributeDefinition("e5");
ESchema_definition schema = inst.findEntityInstanceSdaiModel().getUnderlyingSchema();
EDefined_type[] sel = new EDefined_type[5];
sel[0] = schema.getDefinedType("xi"); // the shrinked select path consists of the defined type with the name 'xi'
inst.set(attr, 99, sel);
After exporting the repository containing 'inst' to an exchange structure,
this value will be written as XI(99).
If the above excerpt from an Express schema was modified slightly by taking
'TYPE upsilon = INTEGER;' instead of 'TYPE upsilon = SET [0:3] OF nu;',
then the following assignment of the same value to 'attr' is classified as
being different from that given before:
sel[0] = schema.getDefinedType("upsilon"); // the shrinked select path consists of the defined type with the name 'upsilon'
sel[1] = null;
inst.set(attr, 99, sel);
In an exchange structure the value will be given as UPSILON(99).
The number of defined data types in the array "select" giving the select path is either specified by the position of the first null value in this array or is equal to the length of this array if it contains no null value.
The list of cases when SdaiException
is thrown
contains the following items:
aggregation_type
;
in the latter case createAggregate
method shall be applied;
This method is a late binding implementation of the "put attribute" operation.
attribute
- the explicit attribute to be assigned a value.value
- the value to be assigned to the attribute.select
- select path corresponding to the value submitted.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- VA_NSET, value not set.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- VA_NVLD, value invalid.
SdaiException
- SY_ERR, underlying system error.set(EAttribute, int, EDefined_type[])
,
set(EAttribute, double, EDefined_type[])
,
set(EAttribute, boolean, EDefined_type[])
,
"ISO 10303-22::10.11.3 put attribute"public void set(jsdai.dictionary.EAttribute attribute, int value, jsdai.dictionary.EDefined_type[] select) throws SdaiException
int
to the specified explicit attribute.
This method is applicable for values of EXPRESS data types
INTEGER, BOOLEAN, LOGICAL, ENUMERATION and REAL.
If the base type of the attribute is select type,
then the select path corresponding to the value
to be assigned needs to be submitted (through the third method's parameter).
Otherwise, null to the third parameter can be passed.
Select path is a sequence of defined data types needed to specify a
value of a select data type (as defined in ISO 10303-21:11.1.8).
The number of defined data types in the array "select"
giving the select path is either specified by the
position of the first null value in this array or is equal
to the length of this array if it contains no null value.
For a definition of the select path and a detailed example see
set(EAttribute, Object, EDefined_type[])
The list of cases when SdaiException
is thrown
contains the following items:
int
type
is disallowed for the attribute whose value is being set or
select path represents EXPRESS data type that cannot be mapped to
Java int
.
This method is a late binding implementation of the "put attribute" operation.
Example:
ETrimmed_curve curve = ...;
EAttribute attr = curve.getAttributeDefinition("master_representation");
curve.set(attr, 15, null);
attribute
- the explicit attribute to be assigned a value.value
- the value to be assigned to the attribute.select
- select path corresponding to the value submitted.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- VA_NSET, value not set.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- VA_NVLD, value invalid.
SdaiException
- SY_ERR, underlying system error.set(EAttribute, Object, EDefined_type[])
,
set(EAttribute, double, EDefined_type[])
,
set(EAttribute, boolean, EDefined_type[])
,
"ISO 10303-22::10.11.3 put attribute"public void set(jsdai.dictionary.EAttribute attribute, double value, jsdai.dictionary.EDefined_type[] select) throws SdaiException
double
to the specified explicit attribute.
This method is applicable for values of EXPRESS data types
REAL, and NUMBER.
If the base type of the attribute is select type,
then the select path corresponding to the value
to be assigned needs to be submitted (through the third method's parameter).
Otherwise, null to the third parameter can be passed.
Select path is a sequence of defined data types needed to specify a
value of a select data type (as defined in ISO 10303-21:11.1.8).
The number of defined data types in the array "select"
giving the select path is either specified by the
position of the first null value in this array or is equal
to the length of this array if it contains no null value.
For a definition of the select path and a detailed example see
set(EAttribute, Object, EDefined_type[])
The list of cases when SdaiException
is thrown
contains the following items:
double
type
is disallowed for the attribute whose value is being set or
select path represents EXPRESS data type that cannot be mapped to
Java double
.
This method is a late binding implementation of the "put attribute" operation.
Example:
EVector vect = ...;
EAttribute attr = vect.getAttributeDefinition("magnitude");
vect.set(attr, 9.99, null);
attribute
- the explicit attribute to be assigned a value.value
- the value to be assigned to the attribute.select
- select path corresponding to the value submitted.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- VA_NSET, value not set.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- VA_NVLD, value invalid.
SdaiException
- SY_ERR, underlying system error.set(EAttribute, Object, EDefined_type[])
,
set(EAttribute, int, EDefined_type[])
,
set(EAttribute, boolean, EDefined_type[])
,
"ISO 10303-22::10.11.3 put attribute"public void set(jsdai.dictionary.EAttribute attribute, boolean value, jsdai.dictionary.EDefined_type[] select) throws SdaiException
boolean
to the specified explicit attribute.
This method is applicable for values of EXPRESS data type BOOLEAN.
If the base type of the attribute is select type,
then the select path corresponding to the value
to be assigned needs to be submitted (through the third method's parameter).
Otherwise, null to the third parameter can be passed.
Select path is a sequence of defined data types needed to specify a
value of a select data type (as defined in ISO 10303-21:11.1.8).
The number of defined data types in the array "select"
giving the select path is either specified by the
position of the first null value in this array or is equal
to the length of this array if it contains no null value.
For a definition of the select path and a detailed example see
set(EAttribute, Object, EDefined_type[])
The list of cases when SdaiException
is thrown
contains the following items:
boolean
type
is disallowed for the attribute whose value is being set or
select path represents EXPRESS data type that cannot be mapped to
Java boolean
.
This method is a late binding implementation of the "put attribute" operation.
Example:
EOriented_edge edge = ...;
EAttribute attr = edge.getAttributeDefinition("orientation");
edge.set(attr, true, null);
attribute
- the explicit attribute to be assigned a value.value
- the value to be assigned to the attribute.select
- select path corresponding to the value submitted.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- VA_NVLD, value invalid.
SdaiException
- SY_ERR, underlying system error.set(EAttribute, Object, EDefined_type[])
,
set(EAttribute, int, EDefined_type[])
,
set(EAttribute, double, EDefined_type[])
,
"ISO 10303-22::10.11.3 put attribute"public void unsetAttributeValue(jsdai.dictionary.EAttribute attribute) throws SdaiException
SdaiException
AT_NDEF and, respectively, AT_NVLD
is thrown.
This method is a late binding implementation of the "unset attribute value" operation.
attribute
- the explicit attribute whose value is to be unset.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- SY_ERR, underlying system error.public Aggregate createAggregate(jsdai.dictionary.EAttribute attribute, jsdai.dictionary.EDefined_type[] select) throws SdaiException
set(EAttribute, Object, EDefined_type[])
The list of cases when SdaiException
is thrown
contains the following items:
This method is a late binding implementation of the "create aggregate instance" operation.
Example:
ETrimmed_curve curve = ...;
EAttribute attr = curve.getAttributeDefinition("trim_1");
ATrimming_select aggr = curve.createAggregate(attr, null);
attribute
- the explicit attribute whose value is to be set
with a new aggregate instance.select
- select path specifying the type of the aggregate
to be assigned.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- VA_NVLD, value invalid.
SdaiException
- SY_ERR, underlying system error.public java.lang.String getPersistentLabel() throws SdaiException
String
, which is a persistent label of this entity instance.
This label is assigned to the instance by JSDAI at the time when this instance is
created, and does not change later - it is persistent.
The label is unique within the repository containing
the instance. The label is defined both for application and dictionary instances.
JSDAI chooses the persistent label in such a way that it satisfies the requirements imposed on the instance names in the clear text encoding of the exchange structure (ISO 10303-21::7.3.4 Entity instance names).
Example:
EEntity inst = ...;
String ident = inst.getPersistentLabel();
The value of ident will be like this:
#2618
SdaiException
- TR_NEXS, transaction does not exist.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.SdaiRepository.getSessionIdentifier(java.lang.String)
,
"ISO 10303-22::10.11.6 Get persistent label"public java.lang.String getDescription() throws SdaiException
SdaiException
- TR_NEXS, transaction does not exist.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.public int validateWhereRule(jsdai.dictionary.EWhere_rule rule, ASdaiModel domain) throws SdaiException
null
,
then all where rules found in the entity definition of this
instance are checked. If the second parameter is null
,
then the domain is only the actual SdaiModel
of the
current instance.
rule
- the where rule.domain
- the list of SdaiModel
s specifying the
area in which to perform the validation of where rules.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- RU_NDEF, rule not defined.
SdaiException
- SY_ERR, underlying system error.
SdaiException
- FN_NAVL, function not available.validateWhereRule(AWhere_rule, ASdaiModel)
public int validateWhereRule(jsdai.dictionary.AWhere_rule viol_rules, ASdaiModel domain) throws SdaiException
null
, then the domain is only
the actual SdaiModel
of the current instance.
viol_rules
- the non-persistent list to which violated
where rules are appended.domain
- the list of SdaiModel
s specifying the
area in which to perform the validation of where rules.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- RU_NDEF, rule not defined.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- SY_ERR, underlying system error.
SdaiException
- FN_NAVL, function not available.validateWhereRule(EWhere_rule, ASdaiModel)
public boolean validateRequiredExplicitAttributesAssigned(jsdai.dictionary.AAttribute nonConf) throws SdaiException
If null is passed to the method's parameter, then SdaiException AI_NEXS is thrown.
nonConf
- the non-persistent list to which non-optional attributes
without values are appended.
true
if all non-optional attributes have values or all attributes are optional,
false
otherwise.
SdaiException
- TR_NEXS, transaction does not exist.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- SY_ERR, an underlying system error occurred.public boolean validateInverseAttributes(jsdai.dictionary.AAttribute nonConf) throws SdaiException
If null is passed to the method's parameter, then SdaiException AI_NEXS is thrown.
nonConf
- the non-persistent list to which the inverse attributes
violating the constraints are appended.
true
if all inverse attribute constraints are satisfied or if
this entity does not have inverse attributes, false
otherwise.
SdaiException
- TR_NEXS, transaction does not exist.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- SY_ERR, an underlying system error occurred.public boolean validateInverseAttributes(jsdai.dictionary.AAttribute nonConf, ASdaiModel domain) throws SdaiException
If null is passed to the method's parameter, then SdaiException AI_NEXS is thrown.
nonConf
- the non-persistent list to which the inverse attributes
violating the constraints are appended.domain
- the list of SdaiModel
s specifying the
area inverse attributes in which shall be validated.
true
if all inverse attribute constraints are satisfied or if
this entity does not have inverse attributes, false
otherwise.
SdaiException
- TR_NEXS, transaction does not exist.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- SY_ERR, an underlying system error occurred.public int validateExplicitAttributesReferences(jsdai.dictionary.AAttribute nonConf) throws SdaiException
If null is passed to the method's parameter, then SdaiException AI_NEXS is thrown.
nonConf
- the non-persistent list to which the attributes referencing
entity instances of wrong type are appended.
SdaiException
- TR_NEXS, transaction does not exist.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- SY_ERR, an underlying system error occurred.public int validateAggregatesSize(jsdai.dictionary.AAttribute nonConf) throws SdaiException
If null is passed to the method's parameter, then SdaiException AI_NEXS is thrown.
nonConf
- the non-persistent list to which the attributes
having as values aggregates of sizes violating the constraints are appended.
SdaiException
- TR_NEXS, transaction does not exist.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- SY_ERR, an underlying system error occurred.public boolean validateAggregatesUniqueness(jsdai.dictionary.AAttribute nonConf) throws SdaiException
If null is passed to the method's parameter, then SdaiException AI_NEXS is thrown.
nonConf
- the non-persistent list to which the attributes
with value violating the aggregate uniqueness requirement are appended.
true
if all uniqueness constraints are satisfied or
this entity instance has no aggregates as attribute values,
false
if at least one aggregate uniqueness constraint is violated.
SdaiException
- TR_NEXS, transaction does not exist.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- SY_ERR, an underlying system error occurred.public boolean validateArrayNotOptional(jsdai.dictionary.AAttribute nonConf) throws SdaiException
If null is passed to the method's parameter, then SdaiException AI_NEXS is thrown.
nonConf
- the non-persistent list to which the attributes with
value of type array violating the requirement to have no unset elements
are appended.
true
if all arrays, in which optional elements
are not allowed, have values at all index positions, or all arrays
are declared to contain optional elements, or this entity instance
has not attributes with array values,
false
if at least one array, that is not declared to
have elements at all positions, is missing at least one element,
or if the array bounds conflict with array type declaration.
SdaiException
- TR_NEXS, transaction does not exist.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- SY_ERR, an underlying system error occurred.public int validateStringWidth(jsdai.dictionary.AAttribute nonConf) throws SdaiException
If null is passed to the method's parameter, then SdaiException AI_NEXS is thrown.
nonConf
- the non-persistant list to which the attributes
whose value is string having invalid width are appended.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AI_NEXS, aggregate instance does not exist.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- SY_ERR, an underlying system error occurred.public int validateBinaryWidth(jsdai.dictionary.AAttribute nonConf) throws SdaiException
Binary
values assigned to attributes of this entity instance
are of the required width.
This method is not implemented in current JSDAI version.
SdaiException FN_NAVL will be thrown if this method is invoked.
nonConf
- the non-persistant list to which the attributes
whose value is Binary
having invalid width are appended.
Binary
values assigned to attributes
are of the correct width,
number 1 if for at least one Binary
value the declared width is violated,
and number 3 if derived attribute value expression does not
evaluate to a determinate value.
SdaiException
- FN_NAVL, function not available.public int validateRealPrecision(jsdai.dictionary.AAttribute nonConf) throws SdaiException
real
values assigned to attributes of this entity instance
are of the required minimum precision.
This method is not implemented in current JSDAI version.
SdaiException FN_NAVL will be thrown if this method is invoked.
nonConf
- the non-persistant list to which the attributes
with real
value violating the declared precision are appended.
real
values assigned to attributes
are of the declared precision,
number 1 if at least one real
value violates the declared precision,
and number 3 if derived attribute value expression does not
evaluate to a determinate value.
SdaiException
- FN_NAVL, function not available.public java.lang.String toString()
String
representing this entity instance
including values of all its attributes.
This representation adheres all mapping rules defined
in "ISO 10303-21: Clear text encoding of the exchange structure".
The entity name may appear either in long form or in short form.
For example, for entity cartesian_point
any of the following cases can be chosen:
shortNameSupport
should be used.
Selecting the short form can give the desired result only if the short name of the entity
is defined in the data dictionary (provided by an Express compiler).
If method fails to identify this name, then the full entity
name is used instead of.
Example:
EVector vect = ...;
System.out.println("instance: " + vect);
The string printed will be like this:
instance: #55=VECTOR('vec5',#1008,7.0);
String
representing this entity instance.getPersistentLabel
,
getDescription
,
SdaiRepository.shortNameSupport(boolean)
,
"ISO 10303-21: Implementation methods: Clear text encoding
of the exchange structure."public jsdai.dictionary.AEntity_definition typeOf() throws SdaiException
Example:
SdaiRepository repo = ...;
EEntity inst2265 = repo.getSessionIdentifier("#2265");
AEntity_definition types2265 = inst2265.typeOf();
for (int i = 1; i <= types2265.getMemberCount(); i++) {
System.out.println("type: " + types2265.getByIndex(i).getName(null));
}
For an instance of the entity "dimension_text_associativity"
in the schema "aic_associative_draughting_elements" the output will be as follows:
type: dimension_text_associativity type: geometric_representation_item type: mapped_item type: representation_item type: text_literal
SdaiException
- EI_NEXS, entity instance does not exist.public java.lang.Object getTemp()
Object
where an application is allowed
to store some user's data related to this entity instance.
This Object
field is not persistent.
Its value is lost when the read-only or read-write access to the owning
SdaiModel
is ended or when the transaction is aborted.
Object
.getTemp(Object key)
,
setTemp(Object key)
,
setTemp(Object key, Object value)
public void setTemp(java.lang.Object value)
Object
in which an application is allowed to store some user's data related
to this entity instance.
This Object
field is not persistent.
Its value is lost when the read-only or read-write access to the owning
SdaiModel
is ended or when the transaction is aborted.
value
- the value for the special Object
field
to be set.getTemp()
,
getTemp(Object key)
,
setTemp(Object key, Object value)
public java.lang.Object getTemp(java.lang.Object key)
getTemp()
. Allows to retrieve more than one user data
object previously stored with this entity using setTemp(Object key, Object value)
.
Object is identified by a key
which has to be the same as
it was provided for method setTemp(Object key, Object value)
. The rest of the
functionality is identical to getTemp()
.
key
- a key which identifies the user data object.
getTemp()
,
setTemp(Object key)
,
setTemp(Object key, Object value)
public void setTemp(java.lang.Object key, java.lang.Object value)
setTemp(Object value)
. Allows to store more than one user data
object with this entity. Object is identified by a key
. Later the same
key
can be used to retrieve the stored data object using
getTemp(Object key)
. The rest of the
functionality is identical to setTemp(Object value)
.
key
- a key which identifies the user data object.value
- the used data value to store.getTemp()
,
getTemp(Object key)
,
setTemp(Object key)
public jsdai.mapping.AEntity_mapping testMappedEntity(jsdai.dictionary.EEntity_definition sourceEntity, ASdaiModel dataDomain, ASdaiModel mappingDomain, int mode) throws SdaiException
Example:
EEntity instance = ...; // instance that we want to check
SdaiModel sourceModel = LangUtils.findDictionaryModel("my_mapping_schema"); // usualy name of mapping model is the same as it is for source schema
sourceModel.startReadOnlyAccess();
armSchema = LangUtils.findSchema(sourceModel);
EEntity_definition sourceEntity = LangUtils.findEntityDefinition("my_source_entity", schema);
AEntity_mapping mappings = m.testSourceEntity(sourceEntity, session.getDataDictionary(), session.getDataMapping());
SdaiIterator i = mappings.createIterator();
System.out.println("The instance " + instance + " is mapping of:");
while (i.next()) {
System.out.print(" " + mappings.getCurrentMember(i).getSource(null).getName(null));
}
sourceEntity
- an entity which mapping is testeddataDomain
- a target instances domain where to search instances to
satisfy mapping constraints. It may be null. Then owning model of
target instance will be used as domain.mappingDomain
- a domain for mapping constraints, target and source schemas.mode
- sets level of cheking for mapped entity.
NO_RESTRICTIONS
- only the mapping constraints for specified entity mapping are tested
MANDATORY_ATTRIBUTES_SET
- all explicit mandatory ARM attributes of every entity mapping are tested.
If at least one these attributes is unset, then this entity mapping is not included in the returned set of entity mappings.
SdaiException
testMappedEntity
,
findEntityMappings(ASdaiModel, ASdaiModel, AEntity_mapping, int)
,
testMappedAttribute
,
getMappedAttribute
,
JSDAI Mapping Extensionpublic boolean testMappedEntity(jsdai.mapping.EEntity_mapping sourceEntity, ASdaiModel dataDomain, ASdaiModel mappingDomain, int mode) throws SdaiException
Example:
EEntity instance = ...; // instance that we want to check
SdaiModel sourceModel = LangUtils.findDictionaryModel("my_mapping_schema"); // usualy name of mapping model is the same as it is for source schema
sourceModel.startReadOnlyAccess();
armSchema = LangUtils.findSchema(sourceModel);
EEntity_definition sourceEntity = LangUtils.findEntityDefinition("my_source_entity", schema);
AEntity_mapping mappings = m.testSourceEntity(sourceEntity, session.getDataDictionary(), session.getDataMapping());
SdaiIterator i = mappings.createIterator();
System.out.println("The instance " + instance + " is mapping of:");
while (i.next()) {
System.out.print(" " + mappings.getCurrentMember(i).getSource(null).getName(null));
}
sourceEntity
- an entity which mapping is testeddataDomain
- a target instances domain where to search instances to
satisfy mapping constraints. It may be null. Then owning model of
target instance will be used as domain.mappingDomain
- a domain for mapping constraints, target and source schemas.mode
- sets level of cheking for mapped entity.
NO_RESTRICTIONS
- only the mapping constraints for specified entity mapping are tested
MANDATORY_ATTRIBUTES_SET
- all explicit mandatory ARM attributes of every entity mapping are tested.
If at least one these attributes is unset, then this function returns false.
SdaiException
testMappedEntity
,
findEntityMappings(ASdaiModel, ASdaiModel, AEntity_mapping, int)
,
testMappedAttribute
,
getMappedAttribute
,
JSDAI Mapping Extensionpublic jsdai.mapping.AGeneric_attribute_mapping testMappedAttribute(jsdai.dictionary.EAttribute sourceAttribute, ASdaiModel dataDomain, ASdaiModel mappingDomain, int mode) throws SdaiException
sourceAttribute
- source attribute which mapping is tested.dataDomain
- a domain where to search instances to satisfy mapping constraints.
It may be null.
Then owning model of target instance will be used as domain.mode
- sets level of cheking for mapped attribute.
NO_RESTRICTIONS
- only the mapping constraints for specified attribute are tested
MOST_SPECIFC_ENTITY
- if ARM type of attribute is enity data type, then the mapping constraints for this entity data type are checked,
MANDATORY_ATTRIBUTES_SET
- in addition all explicit mandatory ARM attributes of every entity mapping are tested.mappingDomain
- a domain for mapping constraints, target and source schemas.
SdaiException
testMappedEntity
,
testMappedAttribute
,
getMappedAttribute
,
JSDAI Mapping Extensionpublic boolean testMappedAttribute(jsdai.mapping.EGeneric_attribute_mapping sourceAttribute, ASdaiModel dataDomain, ASdaiModel mappingDomain, int mode) throws SdaiException
sourceAttribute
- source attribute which mapping is tested.dataDomain
- a target instances domain where to search instances to
satisfy mapping constraints. It may be null. Then owning model of
target instance will be used as domain.mappingDomain
- a domain for mapping constraints, target and source
schemas. It may be null. Then owning model of sourceAttribute will be used as
domain.mode
- sets level of cheking for mapped attribute.
NO_RESTRICTIONS
- only the mapping constraints for specified attribute are tested
MOST_SPECIFC_ENTITY
- if ARM type of attribute is enity data type, then the mapping constraints for this entity data type are checked,
MANDATORY_ATTRIBUTES_SET
- in addition all explicit mandatory ARM attributes of every entity mapping are tested.
SdaiException
testSourceEntity
,
testMappedAttribute
,
getMappedAttribute
,
JSDAI Mapping Extensionpublic java.lang.Object[] getMappedAttribute(jsdai.dictionary.EAttribute sourceAttribute, ASdaiModel dataDomain, ASdaiModel mappingDomain, int mode) throws SdaiException
Example:
EEntity_definition armEntity = ....
ArrayList attributes = new ArrayList();
LangUtils.findExplicitAttributes(armEntity, attributes);
// Iterate through all explicit attributes of ARM entity.
for (int i = 0; i < attributes.size(); i++) {
armAttribute = (EAttribute)attributes.get(i);
try {
// Test if ARM attribute is set.
System.out.print(armAttribute.getName(null));
boolean f = instance.testSourceAttribute(armAttribute, dataSi, mappingSi) != null;
// If ARM attribute is set, then take and print a value of it.
if (f) {
Object o[] = instance.getSourceAttribute(armAttribute, dataSi, mappingSi);
if (o.length > 0) {
if (o[0] instanceof String) {
System.out.print(" = '" + o[0] + "'");
} else {
System.out.print(" = " + o[0]);
}
for (int k = 1; k < o.length; k++) {
if (o[k] instanceof String) {
System.out.print(" | '" + o[k] + "'");
} else {
System.out.print(" | " + o[k]);
}
}
} else {
System.out.print(" = ?");
}
}
System.out.println();
} catch (Exception e) {
}
sourceAttribute
- source attribute which mappings are returned.dataDomain
- a target instances domain where to search instances to satisfy mapping constraints.
It may be null.
Then owning model of target instance will be used as domain.mappingDomain
- a domain for mapping constraints, target and source
schemas. It may be null. Then owning model of sourceAttribute will be used as
domain.mode
- sets level of cheking for mapped attribute.
NO_RESTRICTIONS
- only the mapping constraints for specified attribute are tested
MOST_SPECIFC_ENTITY
- if ARM type of attribute is enity data type, then the mapping constraints for this entity data type are checked,
MANDATORY_ATTRIBUTES_SET
- in addition all explicit mandatory ARM attributes of every entity mapping are tested.
SdaiException
testMappedEntity
,
testMappedAttribute
,
testMappedAttribute
,
JSDAI Mapping Extensionpublic java.lang.Object getMappedAttribute(jsdai.mapping.EGeneric_attribute_mapping sourceAttribute, ASdaiModel dataDomain, ASdaiModel mappingDomain, int mode) throws SdaiException
sourceAttribute
- attribute which mapping is tested.dataDomain
- a domain where to search instances to satisfy mapping constraints.
It may be null.
Then owning model of target instance will be used as domain.mappingDomain
- a domain for mapping constraints, target and source schemas.
It may be null.
Then owning model of sourceAttribute will be used as domain.mode
- sets level of cheking for mapped attribute.
NO_RESTRICTIONS
- only the mapping constraints for specified attribute are tested
MOST_SPECIFC_ENTITY
- if ARM type of attribute is enity data type, then the mapping constraints for this entity data type are checked,
MANDATORY_ATTRIBUTES_SET
- in addition all explicit mandatory ARM attributes of every entity mapping are tested.
SdaiException
testSourceEntity
,
testMappedAttribute
,
testMappedAttribute
,
JSDAI Mapping Extensionpublic int findEntityMappings(jsdai.dictionary.EEntity_definition sourceEntity, ASdaiModel dataDomain, ASdaiModel mappingDomain, jsdai.mapping.AEntity_mapping mappings, int mode) throws SdaiException
sourceEntity
- only mappings of this entity or its subtypes can be included in returned set.
If it is null, then this function works the same as findEntityMappings(ASdaiModel, ASdaiModel, AEntity_mapping, int)
.dataDomain
- a domain of the target instance and instances related to it.
It may be null.
Then owning model of target instance will be used as domain.mappingDomain
- a domain for mapping constraints, target and source schemas.mappings
- the mappings that was found.
This parameter is for read/write access.
The mappings that will be found will be added to this aggregate.mode
- NO_RESTRICTIONS
- no restrictions,
MOST_SPECIFC_ENTITY
- retured mappings are restricted to most specific.
If there is mapping of subtype entity then mapping of supertype entity is not included.
Entities that can not be instanciated are also not included.
SdaiException
testMappedEntity
,
findEntityMappings(ASdaiModel, ASdaiModel, AEntity_mapping, int)
,
JSDAI Mapping Extensionpublic int findEntityMappings(ASdaiModel dataDomain, ASdaiModel mappingDomain, jsdai.mapping.AEntity_mapping mappings, int mode) throws SdaiException
SdaiException
findEntityMappings}.
,
JSDAI Mapping Extensionpublic jsdai.mapping.AEntity_mapping findMostSpecificMappings(ASdaiModel dataDomain, ASdaiModel mappingDomain, jsdai.mapping.AEntity_mapping baseMappings, int mode) throws SdaiException
mappingDomain
- is domain for mapping constraints.dataDomain
- is domain which defines where to search instances that satisfy mapping constraints.
In the case it is null owning model of target instance will be used as data domain.baseMappings
- is an aggregate of mapings which define where to start looking for most specific mappings.
The mappings returned will be mappings for subtypes of source enitity of base mappings.mode
- is mode for mapping operations. It can be one of:
EEntity.NO_RESTRICTIONS
EEntity.MOST_SPECIFC_ENTITY
EEntity.MANDATORY_ATTRIBUTES_SET
SdaiException
- All variety of SdaiExceptions can be thrown.public EMappedARMEntity buildMappedInstance(SdaiContext context, jsdai.dictionary.EEntity_definition mappedInstanceType) throws SdaiException
context
- context where the mapped instance should be created.mappedInstanceType
- mapped entity instance expected type or
null if application is unable to specify expected type.
SdaiException
- if an error occurs during the operation
or in underlying JSDAI operationsfindLinkedMappedInstance(EEntity_definition mappedInstanceType)
,
JSDAI Mapping Extensionpublic EMappedARMEntity findLinkedMappedInstance(jsdai.dictionary.EEntity_definition mappedInstanceType) throws SdaiException
mappedInstanceType
- mapped entity instance expected type or
null if application is unable to specify expected type
SdaiException
- if an error occurs during the operation
or in underlying JSDAI operationsbuildMappedInstance(SdaiContext context, EEntity_definition mappedInstanceType)
,
JSDAI Mapping Extensionpublic boolean compareValuesBoolean(EEntity inst) throws SdaiException
SdaiException
ED_NDEQ is thrown.
When executing this method, values of all attributes
in these two instances are compared.
Passing null value to the method's parameter results in SdaiException VA_NSET.
This method is an extension of JSDAI, which is not a part of the standard.
Example:
EVector vect1 = ...;
EVector vect2 = ...;
boolean equal = vect1.compareValuesBoolean(vect2);
inst
- the entity instance submitted to compare against this
entity instance.
true
if values of the same attributes
of the instances are equal, false
otherwise.
SdaiException
- ED_NDEQ, entity definition not domain equivalent.
SdaiException
- VA_NSET, value not set.compareValuesLogical(jsdai.lang.EEntity)
public int compareValuesLogical(EEntity instance) throws SdaiException
SdaiException FN_NAVL will be thrown if this method is invoked.
This method is an extension of JSDAI, which is not a part of the standard.
instance
- the entity instance submitted to compare against this
entity instance.
SdaiException
- FN_NAVL, function not available.public AEntity findMappedUsers(jsdai.mapping.EEntity_mapping source_type, jsdai.mapping.AAttribute_mapping attribute, ASdaiModel data_domain, ASdaiModel mapping_domain, jsdai.mapping.AAttribute_mapping users, int mode) throws SdaiException
source_type
- mapping of entity data type, which mapping constraints this entity satisfies.attribute
- mappings of attributes, for which inverses will be searched.
The specified attributes must reference to source_type.
If it is not specified, then all attributes that references source_type will be in result set.data_domain
- a domain where to search instances to satisfy mapping constraints.
It may be null.
Then owning model of target instance will be used as domain.mapping_domain
- a domain for mapping constraints, target and source schemas.users
- for attribute mappings, that uses this instance.
It can be null.
It is synchronized with return value.mode
- sets level of cheking for mapped attribute.
NO_RESTRICTIONS
- only the mapping constraints for specified attribute are tested
MOST_SPECIFC_ENTITY
- if ARM type of attribute is enity data type, then the mapping constraints for this entity data type are checked,
MANDATORY_ATTRIBUTES_SET
- in addition all explicit mandatory ARM attributes of every entity mapping are tested.
SdaiException
public boolean hasMappedAttribute(jsdai.mapping.EEntity_mapping entityMapping, jsdai.dictionary.EAttribute attribute, ASdaiModel mappingDomain) throws SdaiException
SdaiException
public ExternalData createExternalData() throws SdaiException
ExternalData
object which holds newly created entity external data
SdaiException
- if this entity already has an external data
SdaiException
- there can be other cases when exception it throwngetExternalData()
,
testExternalData()
,
removeExternalData()
public ExternalData getExternalData() throws SdaiException
ExternalData
object which holds this entity external data
SdaiException
- if this entity has no external data
SdaiException
- there can be other cases when exception it throwncreateExternalData()
,
testExternalData()
,
removeExternalData()
public void removeExternalData() throws SdaiException
ExternalData
object it becomes invalid.
If the entity has no external data this method does nothing.
SdaiException
createExternalData()
,
getExternalData()
,
testExternalData()
public boolean testExternalData() throws SdaiException
SdaiException
createExternalData()
,
getExternalData()
,
removeExternalData()
public void set(jsdai.dictionary.EExplicit_attribute attribute, Value val) throws SdaiException
Value
to the specified explicit attribute. Particularly, it is allowed
for the value to be an aggregate.
Also this method can be used to unset the attribute.
The list of cases when SdaiException
is thrown
contains the following items:
Example:
EData_type dt = SdaiSession.findDataType("myStringType", jsdai.SMy_schema.SMy_schema.class);
Value val = Value.alloc(dt).set("LKSoft");
EAttribute attr = ...;
EEntity inst = ...;
inst.set(attr, val);
attribute
- the explicit attribute to be assigned a value.val
- the value to be assigned to the attribute.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- AT_NVLD, attribute invalid.
SdaiException
- VA_NSET, value not set.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- SY_ERR, underlying system error.public Value get(jsdai.dictionary.EAttribute attribute) throws SdaiException
Value
) of the
specified attribute, which can be either explicit or derived but not inverse.
This method returns meaningfull information even in the case when the
attribute is unset.
In the case when the attribute is of EEntity type and references an instance
whose owning SdaiModel has access mode unset, then Value
contains
some data describing this reference but not the referenced instance itself.
Example:
EVector vect = ...;
EAttribute attr = vect.getAttributeDefinition("orientation");
// access the attribute getting an instance of
Value
Value val = vect.get(attr);
// retrieve an entity instance from Value
EDirection dir = (EDirection)val.getInstance();
attribute
- the attribute which value is needed.
Value
) of the attribute.
SdaiException
- RP_NOPN, repository is not open.
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_EAB, transaction ended abnormally.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- AT_NDEF, attribute not defined.
SdaiException
- VA_NSET, value not set.
SdaiException
- VT_NVLD, value type invalid.
SdaiException
- SY_ERR, underlying system error.public AEntity getAllReferences() throws SdaiException
SdaiException
- RP_NOPN, repository is not open.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- SY_ERR, underlying system error.public boolean isValid()
Object
of type EEntity
represents a valid instance of a population within SdaiSession
.
true
if the current instance is valid,
false
otherwise.public EEntity moveUsersFrom(EEntity src) throws SdaiException
SdaiModel
s with started
read-write access mode are considered.
In the case of a reference from an instance in an SdaiModel
existing in the read-only mode SdaiException MX_NRW is thrown.
If the submitted instance is referenced by an instance in an
SdaiModel
whose access is ended, then such a reference is left
intact.
This method is available only when the entity data type of the current
instance is the same as that of the submitted instance or a subtype of it
(in other words, this.isKindOf(src.getInstanceType()) returns true
).
Example:
SdaiRepository repo = ...;
EEntity inst40 = repo.getSessionIdentifier("#40");
EEntity inst4055 = repo.getSessionIdentifier("#4055");
EEntity move = inst4055.moveUsersFrom(inst40);
// move and inst4055 point to the same entity instance
src
- an entity instance the references to which are moved
to this entity instance
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- FN_NAVL, function not available.
SdaiException
- SY_ERR, underlying system error.public EEntity copyValuesFrom(EEntity src) throws SdaiException
SdaiModel
owning the current instance shall be in
read-write access mode. The source instance retain the values of the attributes.
This method is available only when the entity data types of the current instance and the submitted instance are the same.
Example:
SdaiRepository repo = ...;
EEntity inst2241 = repo.getSessionIdentifier("#2241");
EEntity inst2243 = repo.getSessionIdentifier("#2243");
EEntity copy = inst2241.copyValuesFrom(inst2243);
// copy and inst2241 point to the same entity instance
src
- an entity instance the attribute values of which are
copied to this entity instance
SdaiException
- TR_NAVL, transaction currently not available.
SdaiException
- TR_NRW, transaction not read-write.
SdaiException
- MX_NRW, SDAI-model access not read-write.
SdaiException
- EI_NEXS, entity instance does not exist.
SdaiException
- FN_NAVL, function not available.
SdaiException
- SY_ERR, underlying system error.
|
Copyright © LKSoftWare GmbH, 1999-2008 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |