jsdai.lang
Class SdaiModel

java.lang.Object
  extended byjsdai.lang.SdaiCommon
      extended byjsdai.lang.SdaiModel
All Implemented Interfaces:
QuerySource, SdaiEventSource, SdaiModelConnector

public abstract class SdaiModel
extends jsdai.lang.SdaiCommon
implements SdaiEventSource, QuerySource, SdaiModelConnector

SdaiModel is a Java class used for grouping entity instances. Each entity instance within SdaiSession must belong to some SdaiModel. Each SdaiModel is based upon one EXPRESS schema called underlying schema. The EXPRESS types of all entities whose instances can appear in an SdaiModel shall be defined or declared in the EXPRESS schema underlying for this SdaiModel.

Conceptionally, the SdaiModel can be represented by the following EXPRESS entity:

ENTITY SdaiModel;
  name : String;
  underlyingSchema : ESchema_definition;
  describedSchema : OPTIONAL ESchema_definition;
  repository : SdaiRepository;
  changeDate : OPTIONAL String;
  mode : OPTIONAL int;
  instances : SET [0:?] OF EEntity;
  folders : SET [0:?] OF EntityExtent;
  populatedFolders : SET [0:?] OF EntityExtent;
  defaultLanguage : OPTIONAL String;
  contextIdentifiers     : LIST [0:?] OF String;
INVERSE
  associatedWith  : SET [0:?] OF SchemaInstance FOR associatedModels;
UNIQUE
  UR1: name, repository;
WHERE
  WR1: SELF IN SELF.repository.models;
END_ENTITY;

The attributes defaultLanguage and contextIdentifiers are read-write, whereas all other attributes are read-only. For each attribute a corresponding get method (or methods sometimes) is defined. The changeDate can be retrieved either as String or as long. Similarly, underlyingSchema can be retrieved either as ESchema_definition or as String. The attribute defaultLanguage also has the corresponding set method.

The entity instances together with their grouping into EntityExtents comprise the contents of SdaiModel. To make the instances within the contents of an SdaiModel available, the SdaiModel needs to be started in either read-only or read-write access mode. Upon ending read-only or read-write access all entity instances belonging to this SdaiModel become not available. If some entity instance within a SdaiModel has been created, deleted or modified since the most recent commit, abort or start transaction read-write access operation was performed, then before ending read-write access of this SdaiModel either commit or abort operation has to be applied once again.

Each SdaiModel belongs to exactly one SdaiRepository. The SdaiRepository needs to be opened to access the SdaiModel. Upon closing the SdaiRepository all SdaiModels contained in it become not available. SdaiModels containing dictionary and mapping information belong to special SdaiRepository named "SystemRepository". For these SdaiModels read-write access mode is forbidden.

A SdaiRepository may contain one or more virtual models. Virtual model is an instance of SdaiModel with only 'name' and 'repository' fields set with values. A virtual model has no underlying schema attached to it. Such models are created automatically when unresolved references are detected while starting read-only or read-write access of normal (non-virtual) SdaiModels. When needed, virtual models are (automatically) promoted to normal ones.

See Also:
"ISO 10303-22::8.4.2 sdai_model and 8.4.3 sdai_model_contents"

Field Summary
static int NO_ACCESS
          When getMode returns this value, the contents of this SdaiModel is not accessible.
static int READ_ONLY
          When getMode returns this value, the contents of this SdaiModel is available for read-only access.
static int READ_WRITE
          When getMode returns this value, the contents of this SdaiModel is available for read-write access.
 
Method Summary
 void addSdaiListener(SdaiListener listener)
          Adds SdaiListener extending java.util.EventListener to a special aggregate in this repository.
abstract  SdaiPermission checkPermission()
          Returns this model effective permission which determines the model's access rights.
abstract  void checkRead()
          Throws SdaiException.SY_SEC if the owning session has no read access to this model.
abstract  void checkWrite()
          Throws SdaiException.SY_SEC if the owning session has no write access to this model.
 void connectInConnector(jsdai.lang.SdaiModel.Connector connector)
          Connects connector to the incomming connector ring.
 EEntity copyInstance(EEntity source)
          Makes a copy of the specified instance and puts this copy into the contents of this model.
 AEntity copyInstances(AEntity source)
          Makes a copy of all instances from the specified aggregate to this model.
 EEntity create(ComplexEntityValue values)
          This method is for internal JSDAI use only.
 EEntity createEntityInstance(java.lang.Class provided_class)
          Creates a new entity instance within this SdaiModel.
 EEntity createEntityInstance(jsdai.dictionary.EEntity_definition entity_definition)
          Creates a new entity instance within this SdaiModel.
abstract  void deleteSdaiModel()
          Deletes this SdaiModel together with all entity instances within it.
 void disconnectInConnector(jsdai.lang.SdaiModel.Connector connector)
          Disconnects connector from the incomming connector ring.
abstract  void endReadOnlyAccess()
          Terminates the read-only access for this SdaiModel.
abstract  void endReadWriteAccess()
          Terminates the read-write access for this SdaiModel.
 void exportXml(java.io.OutputStream location, InstanceReader instanceReader)
          Writes this model in XML representation to specified stream.
 AEntity findMappingInstances(jsdai.dictionary.EEntity_definition sourceEntity, ASdaiModel targetDomain, ASdaiModel mappingDomain, jsdai.mapping.AEntity_mapping instanceMappings, int mode)
          Finds instances that are mappings of given source entity.
 AEntity findMappingInstances(jsdai.dictionary.EEntity_definition sourceEntity, ASdaiModel targetDomain, ASdaiModel mappingDomain, int mode)
          Finds instances that are mappings of given source entity.
 AEntity findMappingInstances(jsdai.mapping.EEntity_mapping entityMapping, ASdaiModel targetDomain, ASdaiModel mappingDomain, jsdai.mapping.AEntity_mapping instanceMappings, int mode)
          Finds instances that are mappings of given source entity.
 AEntity findMappingInstances(jsdai.mapping.EEntity_mapping entityMapping, ASdaiModel targetDomain, ASdaiModel mappingDomain, int mode)
          Finds instances that are mappings of given entity mapping.
 ASchemaInstance getAssociatedWith()
          Returns the set of schema instances with which this SdaiModel is currently associated.
 java.lang.String getChangeDate()
          Returns the date and time when this SdaiModel was created or most recently modified.
 long getChangeDateLong()
          Returns a long value of the date and time when this SdaiModel was created or most recently modified.
 A_string getContextIdentifiers()
          Returns an aggregate A_string containing information describing the contexts within which the instances of this model are applicable.
 java.lang.String getDefaultLanguage()
          Returns a String identifying the default language for string values in this model, or null if the default language for this model is not specified.
 jsdai.dictionary.ESchema_definition getDefinedSchema()
          Returns schema definition if this SdaiModel manages dictionary data, and null otherwise.
 jsdai.dictionary.EEntity_definition getEntityDefinition(java.lang.String entity_name)
          Returns entity definition for the entity with the specified name.
 jsdai.dictionary.EEntity_definition getEntityDefinitionByRef(jsdai.query.SerializableRef entityRef)
          Returns entity definition for the entity referenced by specified SerializableRef.
 AEntity getEntityExtentInstances(java.lang.Class provided_class)
          Deprecated, use getInstances(Class type) instead.
 AEntity getEntityExtentInstances(jsdai.dictionary.EEntity_definition entity_definition)
          Deprecated, use getInstances(EEntity_definition type) instead.
 int getExactInstanceCount(java.lang.Class type)
          Returns the number of instances of the specified entity data type within this model.
 int getExactInstanceCount(jsdai.dictionary.EEntity_definition type)
          Returns the number of instances of the specified entity data type within this model.
 int getExactInstanceCount(jsdai.dictionary.EEntity_definition[] types)
          Returns the number of instances of the entity consisting of the specified simple entity data types.
 AEntity getExactInstances(java.lang.Class type)
          Returns a read-only aggregate containing all instances of the specified entity data type.
 AEntity getExactInstances(jsdai.dictionary.EEntity_definition type)
          Returns a read-only aggregate containing all instances of the specified entity data type.
 AEntityExtent getFolders()
          Returns the set of EntityExtents for all entity types available in the EXPRESS schema corresponding to this model.
 java.lang.String getId()
          Returns model identifier as a String.
 int getInstanceCount()
          Returns the number of instances contained in this model.
 int getInstanceCount(java.lang.Class type)
          Returns the number of instances of the specified entity data type and of all its subtypes.
 int getInstanceCount(java.lang.Class[] types)
          Returns the total number of instances of those entities which contain specified simple entity data types.
 int getInstanceCount(jsdai.dictionary.EEntity_definition type)
          Returns the number of instances of the specified entity data type and of all its subtypes.
 int getInstanceCount(jsdai.dictionary.EEntity_definition[] types)
          Returns the total number of instances of those entities which contain specified simple entity data types.
 AEntity getInstances()
          Returns the set of all entity instances contained in this model.
 AEntity getInstances(java.lang.Class type)
          Returns a read-only aggregate containing all instances of the specified entity data type and all instances of all its subtypes.
 AEntity getInstances(java.lang.Class[] types)
          Returns a read-only aggregate consisting of all instances of those entities which contain specified simple entity data types.
 AEntity getInstances(jsdai.dictionary.EEntity_definition type)
          Returns a read-only aggregate containing all instances of the specified entity data type and all instances of all its subtypes.
 AEntity getInstances(jsdai.dictionary.EEntity_definition[] types)
          Returns a read-only aggregate consisting of all instances of those entities which contain specified simple entity data types.
 java.net.URL getLocationURL()
          Returns model location as a URL.
 java.lang.String getLockingUser()
          Returns the name of the user that has placed exclusive lock on remote model.
 int getMode()
          Returns the current access mode for this SdaiModel.
 java.lang.String getName()
          Returns the name of the model as a String.
 java.lang.String getOriginalSchemaName()
          Returns the name of the EXPRESS schema which was assigned to this model in Part 21 file the repository containing this model was imported from.
 AEntityExtent getPopulatedFolders()
          Returns the set of EntityExtents for those entity types available in the EXPRESS schema corresponding to this model for which instances currently exist in the model.
 ASdaiModel getQuerySourceDomain()
          Returns domain in which to perform a search.
 jsdai.query.SerializableRef getQuerySourceDomainRef()
           
 jsdai.query.SerializableRef getQuerySourceInstanceRef()
          Gets the reference to the connected SdaiModel.
 AEntity getQuerySourceInstances()
          Returns starting instances which serve as the first input instance set for a query.
 SdaiRepository getRepository()
          Returns the SdaiRepository to which this SdaiModel belongs.
 jsdai.dictionary.ESchema_definition getUnderlyingSchema()
          Returns definition of the EXPRESS schema on which the contents of this SdaiModel is based on.
 java.lang.String getUnderlyingSchemaString()
          Returns the name of the EXPRESS schema on which the contents of this SdaiModel is based on.
 boolean isModified()
          Informs if this model is modified.
abstract  void promoteSdaiModelToRW()
          Changes the access mode for this SdaiModel from read-only to read-write.
 int query(java.lang.String where, EEntity entity, AEntity result)
          This method is not implemented in current JSDAI version.
abstract  void reduceSdaiModelToRO()
          Changes the access mode for this SdaiModel from read-write to read-only.
 void removeSdaiListener(SdaiListener listener)
          Removes SdaiListener extending java.util.EventListener from the special aggregate in this repository.
 void renameSdaiModel(java.lang.String provided_name)
          Assigns a new name to this SdaiModel.
 SdaiModel resolveConnectedModel()
          Resolve to connected SdaiModel.
 void setDefaultLanguage(java.lang.String value)
          Assigns a String to the attribute identifying the default language for string values in this model.
 void setOriginalSchemaName(java.lang.String name)
          Provides the name of an EXPRESS schema which will be used to relate this model with that schema when exporting the repository containing this model to a Part 21 file.
abstract  void startPartialReadOnlyAccess()
          Makes the contents of this SdaiModel available for read-only access in partial dynamic mode.
abstract  void startPartialReadWriteAccess()
          Makes the contents of this SdaiModel available for read-write access in partial dynamic mode.
abstract  void startReadOnlyAccess()
          Makes the contents of this SdaiModel available for read-only access.
abstract  void startReadWriteAccess()
          Makes the contents of this SdaiModel available for read-write access.
 EEntity substituteInstance(EEntity old)
          Substitutes a given entity instance with a newly created one which is written to the contents of this SdaiModel.
 EEntity substituteInstance(EEntity old, java.lang.Class type)
          Substitutes a given entity instance with a newly created one which is written to the contents of this SdaiModel.
 EEntity substituteInstance(EEntity old, jsdai.dictionary.EEntity_definition entity_definition)
          Substitutes a given entity instance with a newly created one which is written to the contents of this SdaiModel.
 boolean testChangeDate()
          Checks if the creation date or date of the most recent modification of this model was set.
 java.lang.String toString()
          Returns a description of this model as a String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_ACCESS

public static final int NO_ACCESS
When getMode returns this value, the contents of this SdaiModel is not accessible.

See Also:
Constant Field Values

READ_ONLY

public static final int READ_ONLY
When getMode returns this value, the contents of this SdaiModel is available for read-only access.

See Also:
Constant Field Values

READ_WRITE

public static final int READ_WRITE
When getMode returns this value, the contents of this SdaiModel is available for read-write access.

See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
                         throws SdaiException
Returns the name of the model as a String.

The models within a SdaiRepository must have unique names.

Returns:
the name of this SdaiModel.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - SY_ERR, underlying system error.

getId

public java.lang.String getId()
                       throws SdaiException
Returns model identifier as a String.

The models within a SdaiRepository have unique identifiers, which are not reused when some models are deleted and some new created.

Returns:
the identifier of this SdaiModel.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.

getUnderlyingSchema

public jsdai.dictionary.ESchema_definition getUnderlyingSchema()
                                                        throws SdaiException
Returns definition of the EXPRESS schema on which the contents of this SdaiModel is based on. This method is valid only for models containing application data. When applied to models from "System Repository", SdaiException VA_NSET will be thrown.

Returns:
the underlying EXPRESS schema.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
getUnderlyingSchemaString()

getUnderlyingSchemaString

public java.lang.String getUnderlyingSchemaString()
                                           throws SdaiException
Returns the name of the EXPRESS schema on which the contents of this SdaiModel is based on. This method is valid only for models containing application data. When applied to models from "System Repository", SdaiException VA_NSET will be thrown.

Returns:
the name of the underlying EXPRESS schema.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - VA_NSET, value not set.
See Also:
getUnderlyingSchema(), getOriginalSchemaName()

getOriginalSchemaName

public java.lang.String getOriginalSchemaName()
                                       throws SdaiException
Returns the name of the EXPRESS schema which was assigned to this model in Part 21 file the repository containing this model was imported from. If the model belongs to a repository that entered the session by applying an operation different than import from a Part 21 file, then the method returns the name of the schema on which the contents of this SdaiModel is based on. This method is valid only for models containing application data. When applied to models from "System Repository", SdaiException VA_NSET will be thrown.

Returns:
the name of the schema taken from Part 21 file.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - VA_NSET, value not set.
Since:
4.0.0
See Also:
getUnderlyingSchemaString(), setOriginalSchemaName(java.lang.String)

setOriginalSchemaName

public void setOriginalSchemaName(java.lang.String name)
                           throws SdaiException
Provides the name of an EXPRESS schema which will be used to relate this model with that schema when exporting the repository containing this model to a Part 21 file. This supplied name will appear in the Part 21 header entity FILE_SCHEMA and, if repository contains more than one model, additionally in DATA entity opening the data section for the model of interest. This method is valid only for models containing application data. When applied to models from "System Repository", SdaiException VA_NSET will be thrown.

Parameters:
name - the name of an EXPRESS schema.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - VA_NSET, value not set.
Since:
4.1.0
See Also:
getOriginalSchemaName()

getRepository

public SdaiRepository getRepository()
                             throws SdaiException
Returns the SdaiRepository to which this SdaiModel belongs.

Returns:
the owning repository.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.

testChangeDate

public boolean testChangeDate()
                       throws SdaiException
Checks if the creation date or date of the most recent modification of this model was set.

Returns:
true if the date was set, and false otherwise.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
See Also:
getChangeDate(), getChangeDateLong()

getChangeDate

public java.lang.String getChangeDate()
                               throws SdaiException
Returns the date and time when this SdaiModel was created or most recently modified.

Returns:
a String representing the date and time.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - VA_NSET, value not set.
See Also:
testChangeDate(), getChangeDateLong()

getChangeDateLong

public long getChangeDateLong()
                       throws SdaiException
Returns a long value of the date and time when this SdaiModel was created or most recently modified.

Returns:
a long representing the date and time.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - VA_NSET, value not set.
See Also:
testChangeDate(), getChangeDate()

getMode

public int getMode()
            throws SdaiException
Returns the current access mode for this SdaiModel. The contents of an SdaiModel is a collection of entity instances grouped into EntityExtents. For accessing this contents, 3 modes are defined:

NO_ACCESS: contents cannot be accessed;

READ_ONLY: only read operations on the contents are allowed;

READ_WRITE: read-write operations are allowed.

Returns:
the current access mode.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.

getAssociatedWith

public ASchemaInstance getAssociatedWith()
                                  throws SdaiException
Returns the set of schema instances with which this SdaiModel is currently associated. An SdaiModel may be associated with no, one or several SchemaInstances.

Returns:
the set of schema instances, with which this model is associated.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - SY_ERR, underlying system error.

getLockingUser

public java.lang.String getLockingUser()
                                throws SdaiException
Returns the name of the user that has placed exclusive lock on remote model. This method always returns null for local schema instance.

Returns:
the name of the user that has the exclusive lock or null if there is no exclusive lock on the model
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
Since:
4.1.0
See Also:
SdaiSession.lock(jsdai.lang.ASdaiRepository, jsdai.lang.ASchemaInstance, jsdai.lang.ASdaiModel, int)

getFolders

public AEntityExtent getFolders()
                         throws SdaiException
Returns the set of EntityExtents for all entity types available in the EXPRESS schema corresponding to this model. The entity data types in an EXPRESS schema can be defined either directly or indirectly. An SdaiModel contains an EntityExtent for each entity data type. The method is valid only when the access mode for the model is set.

Returns:
the set of all EntityExtents of this model.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
See Also:
getPopulatedFolders()

getPopulatedFolders

public AEntityExtent getPopulatedFolders()
                                  throws SdaiException
Returns the set of EntityExtents for those entity types available in the EXPRESS schema corresponding to this model for which instances currently exist in the model. The entity data types in an EXPRESS schema can be defined either directly or indirectly. An SdaiModel contains an EntityExtent for each entity data type. This method finds those EntityExtents which have at least one entity instance. The method is valid only when the access mode for the model is set.

Returns:
the set of nonempty EntityExtents of this model.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - SY_ERR, underlying system error.
See Also:
getFolders()

getDefaultLanguage

public java.lang.String getDefaultLanguage()
                                    throws SdaiException
Returns a String identifying the default language for string values in this model, or null if the default language for this model is not specified.

After creation of the model using createSdaiModel method the default language is unset. In the case when a model was created during execution of importClearTextEncoding method, this model may contain some value for the default language extracted from the header of the exchange structure (see ISO 10303-21::8.2.4 section_language).

Returns:
String identifying the default language for string values in the model.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
See Also:
setDefaultLanguage(java.lang.String), SdaiRepository.getDefaultLanguage(), SdaiRepository.setDefaultLanguage(java.lang.String), "ISO 10303-21::8.2.4 section_language."

setDefaultLanguage

public void setDefaultLanguage(java.lang.String value)
                        throws SdaiException
Assigns a String to the attribute identifying the default language for string values in this model. To unset the default language, null to the parameter of the method should be passed.

When applying exportClearTextEncoding, the default language, if non-null, will be written to the exchange structure created by the above method.

Parameters:
value - the default language for string values in this model.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
See Also:
getDefaultLanguage(), SdaiRepository.getDefaultLanguage(), SdaiRepository.setDefaultLanguage(java.lang.String), "ISO 10303-21::8.2.4 section_language."

getContextIdentifiers

public A_string getContextIdentifiers()
                               throws SdaiException
Returns an aggregate A_string containing information describing the contexts within which the instances of this model are applicable.

After creation of the model using createSdaiModel method this aggregate is empty. In the case when the model was created during execution of importClearTextEncoding method, this aggregate may contain some context identifiers extracted from the header of the exchange structure (see ISO 10303-21::8.2.5 section_context). That is, this aggregate always exists, but may be empty. During a read-write transaction the aggregate can be modified by adding/modifying/removing its members.

When applying exportClearTextEncoding method, the content of this aggregate, if non-empty, will be written to the exchange structure created by the above method.

Returns:
aggregate containing information describing the contexts.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
See Also:
SdaiRepository.getContextIdentifiers(), "ISO 10303-21::8.2.5 section_context."

isModified

public boolean isModified()
                   throws SdaiException
Informs if this model is modified. A model is called modified if at least one instance within it has been created, deleted or modified since the most recent commit or abort operation was performed.

Returns:
true if this model is modified, and false otherwise.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.

checkPermission

public abstract SdaiPermission checkPermission()
                                        throws SdaiException
Returns this model effective permission which determines the model's access rights.

Returns:
the effective permission
Throws:
SdaiException - if an error occurs performing underlying JSDAI operations
Since:
4.0.1
See Also:
checkRead(), checkWrite(), SdaiPermission

checkRead

public abstract void checkRead()
                        throws SdaiException
Throws SdaiException.SY_SEC if the owning session has no read access to this model. Otherwise this method returns with no action.

Throws:
SdaiException - SY_SEC if the owning session is not granted the read access
SdaiException - if an error occurs performing underlying JSDAI operations
Since:
4.0.1
See Also:
checkPermission(), checkWrite(), SdaiPermission

checkWrite

public abstract void checkWrite()
                         throws SdaiException
Throws SdaiException.SY_SEC if the owning session has no write access to this model. Otherwise this method returns with no action.

Throws:
SdaiException - SY_SEC if the owning session is not granted the write access
SdaiException - if an error occurs performing underlying JSDAI operations
Since:
4.0.1
See Also:
checkPermission(), checkRead(), SdaiPermission

deleteSdaiModel

public abstract void deleteSdaiModel()
                              throws SdaiException
Deletes this SdaiModel together with all entity instances within it. The SdaiModel is also removed from the SdaiRepository this model belongs to.

Deleting of an SdaiModel from "SystemRepository" is forbidden. In this case, SdaiException VT_NVLD is thrown.

Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NRW, transaction not read-write.
SdaiException - TR_EAB, transaction ended abnormally.
SdaiException - RP_NOPN, repository is not open.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SDAI-model access not defined.
SdaiException - MX_RO, SDAI-model access read-only.
SdaiException - VT_NVLD, value type invalid.
SdaiException - MO_LOCK, SDAI-model locked by another user.
SdaiException - RP_LOCK, repository locked by another user.
SdaiException - SY_ERR, underlying system error.
See Also:
"ISO 10303-22::10.7.1 Delete SDAI-model"

renameSdaiModel

public void renameSdaiModel(java.lang.String provided_name)
                     throws SdaiException
Assigns a new name to this SdaiModel. This new name must differ from the names of other models in the same SdaiRepository. If this condition is violated, then SdaiException MO_DUP is thrown. Passing null value to the method's parameter results in SdaiException VA_NSET.

This method realizes the SDAI operation "Rename SDAI-model", specified in ISO 10303-22::10.7.2. Currently, the use of the method is limited: if the model being renamed is referenced by instances in other models (in the same or other repositories), and at the moment of invocation of the method, access of at least one such model is not started (or already ended), then the results of the renaming operation are unpredictable.

Renaming of an SdaiModel from "SystemRepository" is forbidden. In the case of such an attempt, SdaiException VT_NVLD is thrown.

Parameters:
provided_name - new name of this model.
Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NRW, transaction not read-write.
SdaiException - TR_EAB, transaction ended abnormally.
SdaiException - RP_NOPN, repository is not open.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - VT_NVLD, value type invalid.
SdaiException - VA_NSET, value not set.
SdaiException - MO_DUP, SDAI-model duplicate.
SdaiException - SY_ERR, underlying system error.
See Also:
"ISO 10303-22::10.7.2 Rename SDAI-model"

createEntityInstance

public EEntity createEntityInstance(jsdai.dictionary.EEntity_definition entity_definition)
                             throws SdaiException
Creates a new entity instance within this SdaiModel. This method is applicable to only instantiable entities (represented by their definitions), which are encountered in the EXPRESS schema whose definition is underlying for this model. Otherwise, that is, if provided entity is not known for this schema, or is not instantiable, then SdaiException ED_NVLD is thrown. The integer used to construct the name of the created entity instance (see ISO 10303-21::7.3.4) is larger than the number in the name of any already existing instance in the same repository. The attributes of the created entity instance are unset, so the testAttribute method applied to any of them will return value 0.

If null value is passed to the method's parameter, then SdaiException ED_NDEF is thrown.

Parameters:
entity_definition - definition of the entity of which an instance has to be created.
Returns:
the created entity instance.
Throws:
SdaiException - TR_NEXS, transaction does not exist.
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 - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - SY_ERR, underlying system error.
See Also:
createEntityInstance(Class provided_class), "ISO 10303-22::10.7.9 Create entity instance", "ISO 10303-21::7.3.4 Entity instance names"

createEntityInstance

public EEntity createEntityInstance(java.lang.Class provided_class)
                             throws SdaiException
Creates a new entity instance within this SdaiModel. This method is applicable to only instantiable entities (represented by the corresponding class EXxx.class where "xxx" is entity name), which are encountered in the EXPRESS schema whose definition is underlying for this model. Otherwise, that is, if the parameter passed to this method does not allow to identify an entity that is known for this schema, or an entity was identified but is not instantiable, then SdaiException ED_NDEF and, respectively, ED_NVLD is thrown. The integer used to construct the name of the created entity instance (see ISO 10303-21::7.3.4) is larger than the number in the name of any already existing instance in the same repository. The attributes of the created entity instance are unset, so the testAttribute method applied to any of them will return value 0.

If null value is passed to the method's parameter, then SdaiException VA_NSET is thrown.

Parameters:
provided_class - Java class for the entity of which an instance has to be created.
Returns:
the created entity instance.
Throws:
SdaiException - TR_NEXS, transaction does not exist.
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 - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
createEntityInstance(EEntity_definition entity_definition), "ISO 10303-22::10.7.9 Create entity instance", "ISO 10303-21::7.3.4 Entity instance names"

startReadOnlyAccess

public abstract void startReadOnlyAccess()
                                  throws SdaiException
Makes the contents of this SdaiModel available for read-only access. This method is available both for models with the application data and for models in "SystemRepository". In the latter case there is no need for the transaction to be started. If the model contains application data and the dictionary model with the data of the schema that is underlying to the former model is without read-only access, then the access for this dictionary model (contained in "SystemRepository") is started automatically.

The model, if its access was started successfully, is included into the set "active_models" of SdaiSession.

Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NAVL, transaction currently not available.
SdaiException - TR_EAB, transaction ended abnormally.
SdaiException - RP_NOPN, repository is not open.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_RO, SDAI-model access read-only.
SdaiException - MX_RW, SDAI-model access read-write.
SdaiException - MX_NDEF, SDAI-model access not defined.
SdaiException - SY_ERR, underlying system error.
See Also:
startReadWriteAccess(), promoteSdaiModelToRW(), endReadOnlyAccess(), SdaiSession.getActiveModels(), "ISO 10303-22::10.7.3 Start read-only access"

startReadWriteAccess

public abstract void startReadWriteAccess()
                                   throws SdaiException
Makes the contents of this SdaiModel available for read-write access. For models in "SystemRepository" this method is forbidden (SdaiException FN_NAVL is thrown). If the dictionary model with the data of the schema that is underlying to this model is without read-only access, then the access for this dictionary model (contained in "SystemRepository") is started automatically.

The model, if its access was started successfully, is included into the set "active_models" of SdaiSession.

Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NRW, transaction not read-write.
SdaiException - TR_EAB, transaction ended abnormally.
SdaiException - RP_NOPN, repository is not open.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_RO, SDAI-model access read-only.
SdaiException - MX_RW, SDAI-model access read-write.
SdaiException - MX_NDEF, SDAI-model access not defined.
SdaiException - MO_LOCK, SDAI-model locked by another user.
SdaiException - FN_NAVL, function not available.
SdaiException - SY_ERR, underlying system error.
See Also:
startReadOnlyAccess(), reduceSdaiModelToRO(), endReadWriteAccess(), SdaiSession.getActiveModels(), "ISO 10303-22::10.7.6 Start read-write access"

startPartialReadOnlyAccess

public abstract void startPartialReadOnlyAccess()
                                         throws SdaiException
Makes the contents of this SdaiModel available for read-only access in partial dynamic mode. No actual instances are loaded to memory when this method is invoked but needed data is provided lazily on demand. This method is available only for remote SdaiModels

Throws:
SdaiException - if an error occurs during the operation
SdaiException - FN_NAVL, if the method is invoked for non remote SdaiModel

startPartialReadWriteAccess

public abstract void startPartialReadWriteAccess()
                                          throws SdaiException
Makes the contents of this SdaiModel available for read-write access in partial dynamic mode. No actual instances are loaded to memory when this method is invoked but needed data is provided lazily on demand. This method is available only for remote SdaiModels

Throws:
SdaiException - if an error occurs during the operation
SdaiException - FN_NAVL, if the method is invoked for non remote SdaiModel

promoteSdaiModelToRW

public abstract void promoteSdaiModelToRW()
                                   throws SdaiException
Changes the access mode for this SdaiModel from read-only to read-write. For models in "SystemRepository" this method is forbidden (SdaiException FN_NAVL is thrown).

Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NRW, transaction not read-write.
SdaiException - TR_EAB, transaction ended abnormally.
SdaiException - RP_NOPN, repository is not open.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_RO, SDAI-model access read-only.
SdaiException - MX_RW, SDAI-model access read-write.
SdaiException - MX_NDEF, SDAI-model access not defined.
SdaiException - FN_NAVL, function not available.
SdaiException - SY_ERR, underlying system error.
See Also:
endReadOnlyAccess(), "ISO 10303-22::10.7.4 Promote SDAI-model to read-write"

reduceSdaiModelToRO

public abstract void reduceSdaiModelToRO()
                                  throws SdaiException
Changes the access mode for this SdaiModel from read-write to read-only. If some entity instance within this SdaiModel has been created, deleted or modified since the most recent commit, abort or start transaction read-write access operation was performed, then SdaiException TR_RW is thrown.

This method is an extension of JSDAI, which is not a part of the standard.

Throws:
SdaiException - TR_RW, transaction read-write.
SdaiException - TR_EAB, transaction ended abnormally.
SdaiException - RP_NOPN, repository is not open.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_RO, SDAI-model access read-only.
SdaiException - MX_NDEF, SDAI-model access not defined.
SdaiException - SY_ERR, underlying system error.
See Also:
endReadWriteAccess(), SdaiTransaction.commit(), SdaiTransaction.abort(), SdaiSession.startTransactionReadWriteAccess()

endReadOnlyAccess

public abstract void endReadOnlyAccess()
                                throws SdaiException
Terminates the read-only access for this SdaiModel. As a result, the contents of the model becomes inaccessable. The model is removed from the set "active_models" of SdaiSession. When applied to a model in "SystemRepository", this method throws SdaiException FN_NAVL.

Throws:
SdaiException - RP_NOPN, repository is not open.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SDAI-model access not defined.
SdaiException - MX_RW, SDAI-model access read-write.
SdaiException - FN_NAVL, function not available.
SdaiException - SY_ERR, underlying system error.
See Also:
startReadOnlyAccess(), promoteSdaiModelToRW(), SdaiSession.getActiveModels(), "ISO 10303-22::10.7.5 End read-only access"

endReadWriteAccess

public abstract void endReadWriteAccess()
                                 throws SdaiException
Terminates the read-write access for this SdaiModel. As a result, the contents of the model becomes inaccessable. The model is removed from the set "active_models" of SdaiSession. If some entity instance within this SdaiModel has been created, deleted or modified since the most recent commit, abort or start transaction read-write access operation was performed, then SdaiException TR_RW is thrown.

Throws:
SdaiException - TR_RW, transaction read-write.
SdaiException - RP_NOPN, repository is not open.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SDAI-model access not defined.
SdaiException - MX_RO, SDAI-model access read-only.
SdaiException - SY_ERR, underlying system error.
See Also:
startReadWriteAccess(), reduceSdaiModelToRO(), SdaiSession.getActiveModels(), "ISO 10303-22::10.7.7 End read-write access"

addSdaiListener

public void addSdaiListener(SdaiListener listener)
Adds SdaiListener extending java.util.EventListener to a special aggregate in this repository.

Specified by:
addSdaiListener in interface SdaiEventSource
Parameters:
listener - a SdaiListener to be added.
Since:
4.1.0
See Also:
removeSdaiListener(jsdai.lang.SdaiListener)

removeSdaiListener

public void removeSdaiListener(SdaiListener listener)
Removes SdaiListener extending java.util.EventListener from the special aggregate in this repository.

Specified by:
removeSdaiListener in interface SdaiEventSource
Parameters:
listener - SdaiListener to be removed.
Since:
4.1.0
See Also:
addSdaiListener(jsdai.lang.SdaiListener)

query

public int query(java.lang.String where,
                 EEntity entity,
                 AEntity result)
          throws SdaiException
This method is not implemented in current JSDAI version.

SdaiException FN_NAVL will be thrown if this method is invoked.

Specified by:
query in interface QuerySource
Parameters:
where - a String value
entity - an EEntity value
result - an AEntity value
Returns:
an int value
Throws:
SdaiException - FN_NAVL, function not available.
See Also:
"ISO 10303-22::10.4.14 SDAI query"

getQuerySourceDomain

public ASdaiModel getQuerySourceDomain()
                                throws SdaiException
Description copied from interface: QuerySource
Returns domain in which to perform a search.

Specified by:
getQuerySourceDomain in interface QuerySource
Returns:
ASdaiModel containing the domain
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations

getQuerySourceInstances

public AEntity getQuerySourceInstances()
                                throws SdaiException
Description copied from interface: QuerySource
Returns starting instances which serve as the first input instance set for a query.

Specified by:
getQuerySourceInstances in interface QuerySource
Returns:
AEntity containing the instances or null this aggregate consists all instances in query source domain
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations

getQuerySourceInstanceRef

public jsdai.query.SerializableRef getQuerySourceInstanceRef()
                                                      throws SdaiException
Description copied from interface: SdaiModelConnector
Gets the reference to the connected SdaiModel. This method is intended for internal use only.

Specified by:
getQuerySourceInstanceRef in interface QuerySource
Throws:
SdaiException
Since:
3.6.0

getQuerySourceDomainRef

public jsdai.query.SerializableRef getQuerySourceDomainRef()
                                                    throws SdaiException
Specified by:
getQuerySourceDomainRef in interface QuerySource
Throws:
SdaiException
Since:
3.6.0

getEntityDefinition

public jsdai.dictionary.EEntity_definition getEntityDefinition(java.lang.String entity_name)
                                                        throws SdaiException
Returns entity definition for the entity with the specified name. This method searches the set of entities that are encountered in the EXPRESS schema whose definition is underlying for this model. Method's parameter is some string giving the name of an entity. If this entity is complex, then its constituents (simple entity data types) within this string are separated by '+' character. For example, "length_unit+si_unit". Both lower case letters and upper case letters are acceptable. If this parameter does not allow to identify an entity that is known for this schema, then SdaiException ED_NDEF is thrown. Passing null value to the method's parameter results in SdaiException VA_NSET.

Parameters:
entity_name - the name of the entity whose definition is requested.
Returns:
definition of the specified entity.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
SchemaDefinition.getEntityDefinition(java.lang.String), "ISO 10303-22::10.7.8 Get entity definition"

getDefinedSchema

public jsdai.dictionary.ESchema_definition getDefinedSchema()
                                                     throws SdaiException
Returns schema definition if this SdaiModel manages dictionary data, and null otherwise.

This method is an extension of JSDAI, which is not a part of the standard.

Returns:
definition of the schema which is described by this SdaiModel.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SDAI-model access not defined.

substituteInstance

public EEntity substituteInstance(EEntity old,
                                  jsdai.dictionary.EEntity_definition entity_definition)
                           throws SdaiException
Substitutes a given entity instance with a newly created one which is written to the contents of this SdaiModel. The given entity instance can belong to other model and even to other repository. Moreover, the entity type of the given instance and that of the new one may be different. This new entity must be instantiable and must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, that is, if this entity is not known for this schema, or is not instantiable, then SdaiException ED_NVLD is thrown. At the end of the operation the given instance is deleted from its owning model.

If entity type supplied for creation of new instance is the same as entity type of the given one, then values of all attributes are passed from the old instance to its substitute. If entity types are different, then values are passed only for common parts of these entities. The remaining attributes are left unset, so the testAttribute method applied to any of them will return value 0. If the given instance belongs to the same repository as this model does, then its substitute gets the persistent label (or name as specified in ISO 10303-21::7.3.4) of it. Otherwise, new persistent label for the substitute is chosen. The integer used to construct it is taken larger than the number in the persistent label of any already existing instance in the same repository. All the references from other instances within models in at least read-only mode to the given instance are replaced by the references to its substitute.

If null value is passed to one of the method's parameters specifying the given instance and entity type for its substitute, then SdaiException VA_NSET and, respectively, ED_NDEF is thrown. Submitting an invalid instance leads to throwing SdaiException EI_NEXS.

This method is an extension of JSDAI, which is not a part of the standard.

Parameters:
old - given entity instance.
entity_definition - definition of the entity of which an instance has to substitute the given one.
Returns:
the created entity instance which substitutes the old one.
Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NRW, transaction not read-write.
SdaiException - TR_EAB, transaction ended abnormally.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - MX_NRW, SDAI-model access not read-write.
SdaiException - EI_NEXS, entity instance does not exist.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
substituteInstance(EEntity old, Class type), substituteInstance(EEntity old), "ISO 10303-21::7.3.4 Entity instance names"

substituteInstance

public EEntity substituteInstance(EEntity old,
                                  java.lang.Class type)
                           throws SdaiException
Substitutes a given entity instance with a newly created one which is written to the contents of this SdaiModel. The given entity instance can belong to other model and even to other repository. Moreover, the entity type of the given instance and that of the new one may be different. This new entity (represented by the corresponding java class EXxx.class where "xxx" is entity name) must be instantiable and must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, that is, if the second parameter passed to this method does not allow to identify an entity that is known for this schema, or an entity was identified but is not instantiable, then SdaiException ED_NDEF and, respectively, ED_NVLD is thrown. At the end of the operation the given instance is deleted from its owning model.

If entity type supplied (through the second parameter) for creation of new instance is the same as entity type of the given one, then values of all attributes are passed from the old instance to its substitute. If entity types are different, then values are passed only for common parts of these entities. The remaining attributes are left unset, so the testAttribute method applied to any of them will return value 0. If the given instance belongs to the same repository as this model does, then its substitute gets the persistent label (or name as specified in ISO 10303-21::7.3.4) of it. Otherwise, new persistent label for the substitute is chosen. The integer used to construct it is taken larger than the number in the persistent label of any already existing instance in the same repository. All the references from other instances within models in at least read-only mode to the given instance are replaced by the references to its substitute.

If null value is passed to either of the method's parameters, then SdaiException VA_NSET is thrown. Submitting an invalid instance leads to throwing SdaiException EI_NEXS.

This method is an extension of JSDAI, which is not a part of the standard.

Parameters:
old - given entity instance.
type - Java class for the entity of which an instance has to substitute the given one.
Returns:
the created entity instance which substitutes the old one.
Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NRW, transaction not read-write.
SdaiException - TR_EAB, transaction ended abnormally.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - MX_NRW, SDAI-model access not read-write.
SdaiException - EI_NEXS, entity instance does not exist.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
substituteInstance(EEntity old, EEntity_definition entity_definition), substituteInstance(EEntity old), "ISO 10303-21::7.3.4 Entity instance names"

substituteInstance

public EEntity substituteInstance(EEntity old)
                           throws SdaiException
Substitutes a given entity instance with a newly created one which is written to the contents of this SdaiModel. The given entity instance can belong to other model and even to other repository. The entity type of the new instance is the same as that of the given one. This entity type must be instantiable and must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, that is, if this entity is not known for this schema, or is not instantiable, then SdaiException ED_NVLD is thrown. At the end of the operation the given instance is deleted from its owning model.

The values of all attributes of the old instance are passed to its substitute. If the given instance belongs to the same repository as this model does, then its substitute gets the persistent label (or name as specified in ISO 10303-21::7.3.4) of it. Otherwise, new persistent label for the substitute is chosen. The integer used to construct it is taken larger than the number in the persistent label of any already existing instance in the same repository. All the references from other instances within models in at least read-only mode to the given instance are replaced by the references to its substitute.

If null value is passed to the method's parameter, then SdaiException VA_NSET is thrown. Submitting an invalid instance leads to throwing SdaiException EI_NEXS.

This method is an extension of JSDAI, which is not a part of the standard.

Parameters:
old - given entity instance.
Returns:
the created entity instance which substitutes the old one.
Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NRW, transaction not read-write.
SdaiException - TR_EAB, transaction ended abnormally.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - MX_NRW, SDAI-model access not read-write.
SdaiException - EI_NEXS, entity instance does not exist.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
substituteInstance(EEntity old, EEntity_definition entity_definition), substituteInstance(EEntity old, Class type), "ISO 10303-21::7.3.4 Entity instance names"

findMappingInstances

public AEntity findMappingInstances(jsdai.dictionary.EEntity_definition sourceEntity,
                                    ASdaiModel targetDomain,
                                    ASdaiModel mappingDomain,
                                    int mode)
                             throws SdaiException
Finds instances that are mappings of given source entity. Instances that satisfies mapping constraints must be in this model, but other instances required by mapping constraints may be in other models within given target domain. This method first finds all possible mappings. These mappings should be defined in specified mapping domain. Then it finds instances for every mapping.

Example:

    SdaiModel m = ...;
    EEntity_definition sourceEntity = ...;  // definition of source entity
    AEntity instances = m.findMappingInstances(sourceEntity, targetDomain, mappingDomain, EEntity.NO_RESTRICTIONS);

This method is part of the mapping extensions of JSDAI.

Parameters:
sourceEntity - this method searches instances that are mappings of this entity
targetDomain - the domain where to search instances to satisfy mapping constraints. It can be null.
mappingDomain - the domain for mapping constraints and dictionary data.
mode - EEntity.NO_RESTRICTIONS - no restrictions, EEntity.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. EEntity.MANDATORY_ATTRIBUTES_SET - in addition to MOST_SPECIFIC_ENTITY it also requires, that all explicit mandatory attributes are set.
Returns:
list of instances that satisfy requirements. Every instance is mentioned only once in this list (elements of list are unique). It will return null if there are no instances that are valid mappings of given entity.
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
findMappingInstances(EEntity_mapping, ASdaiModel, ASdaiModel, int), EEntity.testMappedEntity, EEntity.findEntityMappings(EEntity_definition, ASdaiModel, ASdaiModel, AEntity_mapping, int), EEntity.findEntityMappings(ASdaiModel, ASdaiModel, AEntity_mapping, int), ASdaiModel.findMappingInstances(EEntity_definition, ASdaiModel, ASdaiModel, int), JSDAI Mapping Extension

findMappingInstances

public AEntity findMappingInstances(jsdai.dictionary.EEntity_definition sourceEntity,
                                    ASdaiModel targetDomain,
                                    ASdaiModel mappingDomain,
                                    jsdai.mapping.AEntity_mapping instanceMappings,
                                    int mode)
                             throws SdaiException
Finds instances that are mappings of given source entity. This method provides the similar functionality as findMappingInstances(EEntity_definition, ASdaiModel, ASdaiModel, int) and adds extra possibility to get most specific mappings of the instances.

This method is part of the mapping extensions of JSDAI.

Parameters:
sourceEntity - this method searches instances that are mappings of this entity
targetDomain - the domain where to search instances to satisfy mapping constraints. It can be null.
mappingDomain - the domain for mapping constraints and dictionary data.
instanceMappings - if not null should be an empty aggregate. The most specific entity mappings are returned in this aggregate. The member indexes are synchronized with instance aggregate which is returned from this method. If null then the method works as findMappingInstances(EEntity_definition, ASdaiModel, ASdaiModel, int)
mode - Should always be EEntity.NO_RESTRICTIONS - no restrictions.
Returns:
list of instances that satisfy requirements. If instanceMappings is not null then member indexes in both aggregates make pairs. Every pair (instance, instanceMapping) is mentioned in both aggregates only once. If instanceMappings is null then every instance is mentioned only once in this aggregate.
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
findMappingInstances(EEntity_definition, ASdaiModel, ASdaiModel, int), EEntity.findMostSpecificMappings(jsdai.lang.ASdaiModel, jsdai.lang.ASdaiModel, jsdai.mapping.AEntity_mapping, int), JSDAI Mapping Extension

findMappingInstances

public AEntity findMappingInstances(jsdai.mapping.EEntity_mapping entityMapping,
                                    ASdaiModel targetDomain,
                                    ASdaiModel mappingDomain,
                                    int mode)
                             throws SdaiException
Finds instances that are mappings of given entity mapping. This method is more specific than findMappingInstances(EEntity_definition, ASdaiModel, ASdaiModel, int), because it searches instances that meets requirements only for specified mapping. Instances that satisfy mapping constraints must be in this model, but other instances required by mapping constraints may be in other models within target domain.

Example:

    SdaiModel m = ...;
    EEntity_mapping mapping = ...;  // mapping of source entity
    AEntity instances = m.findMappingInstances(sourceEntity, targetDomain, mappingDomain, EEntity.NO_RESTRICTIONS);

This method is part of the mapping extensions of JSDAI.

Parameters:
entityMapping - this method searches instances that satisfies constraints for this entity mapping.
targetDomain - targetInstances domain where to search instances to satisfy mapping constraints. It can be null.
mappingDomain - the domain for mapping constraints and dictionary data.
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. MANDATORY_ATTRIBUTES_SET - in addition to MOST_SPECIFIC_ENTITY it also requires, that all explicit mandatory attributes are set.
Returns:
list of intstances that satisfy requirements. One instance is mentined only one in this list (elements of list are unique). It will return null if there are no instances that mets constraints of given entity mapping.
Throws:
SdaiException
See Also:
findMappingInstances(EEntity_definition, ASdaiModel, ASdaiModel, int), EEntity.testMappedEntity(EEntity_mapping, ASdaiModel, ASdaiModel, int), EEntity.findEntityMappings(ASdaiModel, ASdaiModel, AEntity_mapping, int), ASdaiModel.findMappingInstances(EEntity_mapping, ASdaiModel, ASdaiModel, int), JSDAI Mapping Extension

findMappingInstances

public AEntity findMappingInstances(jsdai.mapping.EEntity_mapping entityMapping,
                                    ASdaiModel targetDomain,
                                    ASdaiModel mappingDomain,
                                    jsdai.mapping.AEntity_mapping instanceMappings,
                                    int mode)
                             throws SdaiException
Finds instances that are mappings of given source entity. This method provides the similar functionality as findMappingInstances(EEntity_mapping, ASdaiModel, ASdaiModel, int) and adds extra possibility to get most specific mappings of the instances.

This method is part of the mapping extensions of JSDAI.

Parameters:
entityMapping - this method searches instances that satisfies constraints for this entity mapping.
targetDomain - the domain where to search instances to satisfy mapping constraints. It can be null.
mappingDomain - the domain for mapping constraints and dictionary data.
instanceMappings - if not null should be an empty aggregate. The most specific entity mappings are returned in this aggregate. The member indexes are synchronized with instance aggregate which is returned from this method. If null then the method works as findMappingInstances(EEntity_definition, ASdaiModel, ASdaiModel, int)
mode - Should always be EEntity.NO_RESTRICTIONS - no restrictions.
Returns:
list of instances that satisfy requirements. If instanceMappings is not null then member indexes in both aggregates make pairs. Every pair (instance, instanceMapping) is mentioned in both aggregates only once. If instanceMappings is null then every instance is mentioned only once in this aggregate.
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
findMappingInstances(EEntity_mapping, ASdaiModel, ASdaiModel, int), EEntity.findMostSpecificMappings(jsdai.lang.ASdaiModel, jsdai.lang.ASdaiModel, jsdai.mapping.AEntity_mapping, int), JSDAI Mapping Extension

getInstances

public AEntity getInstances()
                     throws SdaiException
Returns the set of all entity instances contained in this model. This set, in fact, represents the contents of the model. The method is valid only when the access mode for the model is set.

Returns:
the set containing all entity instances of the SdaiModel.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.

getInstances

public AEntity getInstances(jsdai.dictionary.EEntity_definition type)
                     throws SdaiException
Returns a read-only aggregate containing all instances of the specified entity data type and all instances of all its subtypes. The aggregate can be cast to the aggregate specific for the given entity type. This entity type must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, SdaiException ED_NVLD is thrown. Passing null value to the method's parameter results in SdaiException ED_NDEF.

Example:

    SdaiModel m = ...;
    EEntity_definition cp_type = ...;  // cartesian point
    ACartesian_point aggr = (ACartesian_point)m.getInstances(cp_type);

Parameters:
type - definition of the entity of which instances are required.
Returns:
aggregate containing all instances of the specified entity data type.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - SY_ERR, underlying system error.
See Also:
getInstances(Class type), getInstances(EEntity_definition types[]), getInstances(Class types[]), getExactInstances(EEntity_definition type), getExactInstances(Class type), getInstanceCount(EEntity_definition type)

getInstances

public AEntity getInstances(java.lang.Class type)
                     throws SdaiException
Returns a read-only aggregate containing all instances of the specified entity data type and all instances of all its subtypes. The aggregate can be cast to the aggregate specific for the given entity type. This entity type (represented by the method's parameter) must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, that is, if the parameter passed to this method does not allow to identify an entity that is known for this schema, then SdaiException ED_NDEF is thrown. A value passed to the parameter should be in the form EXxx.class, where xxx is the name of the entity. Passing null value to the method's parameter results in SdaiException VA_NSET.

Example:

    SdaiModel m = ...;
    ACartesian_point aggr = (ACartesian_point)m.getInstances(ECartesian_point.class);

Parameters:
type - Java class for the entity of which instances are required.
Returns:
aggregate containing all instances of the specified entity data type.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
getInstances(EEntity_definition type), getInstances(EEntity_definition types[]), getInstances(Class types[]), getExactInstances(EEntity_definition type), getExactInstances(Class type), getInstanceCount(Class type)

getInstances

public AEntity getInstances(jsdai.dictionary.EEntity_definition[] types)
                     throws SdaiException
Returns a read-only aggregate consisting of all instances of those entities which contain specified simple entity data types. An array of definitions of simple entity data types is passed through the parameter of this method. The number of entity data types 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. If null value is passed to the method's parameter, then SdaiException ED_NDEF is thrown.

Example:

    SdaiModel m = ...;
    EEntity_definition [] types = new EEntity_definition[5];
    types[0] = m.getEntityDefinition("C"); // definition for entity C
    types[1] = m.getEntityDefinition("E"); // definition for entity E
    types[2] = null;
      // If, for example, entity A is a subtype of entities C, D and E,
      // and entity B is a subtype of entities C, E and F,
      // then the aggregate returned by the following application
      // of getInstances will contain all instances of both A and B.
    AEntity aggr = m.getInstances(types);

Parameters:
types - an array of definitions of simple entity data types.
Returns:
aggregate consisting of all instances of those entities which contain specified simple entity data types.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - SY_ERR, underlying system error.
See Also:
getInstances(EEntity_definition type), getInstances(Class type), getInstances(Class types[]), getExactInstances(EEntity_definition type), getExactInstances(Class type), getInstanceCount(EEntity_definition types[])

getInstances

public AEntity getInstances(java.lang.Class[] types)
                     throws SdaiException
Returns a read-only aggregate consisting of all instances of those entities which contain specified simple entity data types. An array of classes representing simple entity data types is passed through the parameter of this method. Each element in this array shall be in the form CXxx.class, where xxx is the name of the entity. The number of entity data types 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. If null value is passed to the method's parameter, then SdaiException VA_NSET is thrown.

Example:

    SdaiModel m = ...;
    Class [] types = new Class[5];
    types[0] = CC.class; // class for entity C
    types[1] = CE.class; // class for entity E
    types[2] = null;
      // If, for example, entity A is a subtype of entities C, D and E,
      // and entity B is a subtype of entities C, E and F,
      // then the aggregate returned by the following application
      // of getInstances will contain all instances of both A and B.
    AEntity aggr = m.getInstances(types);

Parameters:
types - an array of classes representing simple entity data types.
Returns:
aggregate consisting of all instances of those entities which contain specified simple entity data types.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
getInstances(EEntity_definition type), getInstances(Class type), getInstances(EEntity_definition types[]), getExactInstances(EEntity_definition type), getExactInstances(Class type), getInstanceCount(Class types[])

getExactInstances

public AEntity getExactInstances(jsdai.dictionary.EEntity_definition type)
                          throws SdaiException
Returns a read-only aggregate containing all instances of the specified entity data type. The instances of any of its subtypes are not included into this aggregate. The aggregate can be cast to the aggregate specific for the given entity type. This entity type must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, SdaiException ED_NVLD is thrown. Passing null value to the method's parameter results in SdaiException ED_NDEF.

Example:

    SdaiModel m = ...;
    EEntity_definition cp_type = ...;  // cartesian point
    ACartesian_point aggr = (ACartesian_point)m.getExactInstances(cp_type);

Parameters:
type - definition of the entity of which instances are required.
Returns:
aggregate containing all instances of the specified entity data type.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - SY_ERR, underlying system error.
See Also:
getInstances(EEntity_definition type), getInstances(Class type), getInstances(EEntity_definition types[]), getInstances(Class types[]), getExactInstances(Class type), getExactInstanceCount(EEntity_definition type)

getExactInstances

public AEntity getExactInstances(java.lang.Class type)
                          throws SdaiException
Returns a read-only aggregate containing all instances of the specified entity data type. The instances of any of its subtypes are not included into this aggregate. The aggregate can be cast to the aggregate specific for the given entity type. This entity type (represented by the method's parameter) must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, that is, if the parameter passed to this method does not allow to identify an entity that is known for this schema, then SdaiException ED_NDEF is thrown. A value passed to the parameter should be in the form CXxx.class, where xxx is the name of the entity. Passing null value to the method's parameter results in SdaiException VA_NSET.

Example:

    SdaiModel m = ...;
    ACartesian_point aggr = (ACartesian_point)m.getExactInstances(CCartesian_point.class);

Parameters:
type - Java class for the entity of which instances are required.
Returns:
aggregate containing all instances of the specified entity data type.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
getInstances(EEntity_definition type), getInstances(Class type), getInstances(EEntity_definition types[]), getInstances(Class types[]), getExactInstances(EEntity_definition type), getExactInstanceCount(Class type)

getInstanceCount

public int getInstanceCount()
                     throws SdaiException
Returns the number of instances contained in this model.

Returns:
the number of instances.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
See Also:
getInstanceCount(EEntity_definition type), getInstanceCount(Class type), getInstanceCount(EEntity_definition types[]), getInstanceCount(Class types[]), getExactInstanceCount(EEntity_definition type), getExactInstanceCount(Class type), getExactInstanceCount(EEntity_definition types[])

getInstanceCount

public int getInstanceCount(jsdai.dictionary.EEntity_definition type)
                     throws SdaiException
Returns the number of instances of the specified entity data type and of all its subtypes. Only instances contained in this model are counted. The given entity data type must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, SdaiException ED_NVLD is thrown. Passing null value to the method's parameter results in SdaiException ED_NDEF.

Parameters:
type - definition of the entity of which the instance count is required.
Returns:
the number of instances of the specified entity data type.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
See Also:
getInstanceCount(), getInstanceCount(Class type), getInstanceCount(EEntity_definition types[]), getInstanceCount(Class types[]), getExactInstanceCount(EEntity_definition type), getExactInstanceCount(Class type), getExactInstanceCount(EEntity_definition types[]), getInstances(EEntity_definition type)

getInstanceCount

public int getInstanceCount(java.lang.Class type)
                     throws SdaiException
Returns the number of instances of the specified entity data type and of all its subtypes. Only instances contained in this model are counted. The given entity data type (represented by the method's parameter) must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, that is, if the parameter passed to this method does not allow to identify an entity that is known for this schema, then SdaiException ED_NDEF is thrown. A value passed to the parameter should be in the form EXxx.class, where xxx is the name of the entity. Passing null value to the method's parameter results in SdaiException VA_NSET.

Parameters:
type - Java class for the entity of which the instance count is required.
Returns:
the number of instances of the specified entity data type.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
See Also:
getInstanceCount(), getInstanceCount(EEntity_definition type), getInstanceCount(EEntity_definition types[]), getInstanceCount(Class types[]), getExactInstanceCount(EEntity_definition type), getExactInstanceCount(Class type), getExactInstanceCount(EEntity_definition types[]), getInstances(Class type)

getInstanceCount

public int getInstanceCount(jsdai.dictionary.EEntity_definition[] types)
                     throws SdaiException
Returns the total number of instances of those entities which contain specified simple entity data types. Only instances contained in this model are counted. An array of definitions of simple entity data types is passed through the parameter of this method. The number of entity data types 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. If null value is passed to the method's parameter, then SdaiException ED_NDEF is thrown.

Example:

    SdaiModel m = ...;
    EEntity_definition [] types = new EEntity_definition[5];
    types[0] = m.getEntityDefinition("C"); // definition for entity C
    types[1] = m.getEntityDefinition("E"); // definition for entity E
    types[2] = null;
      // If, for example, entity A is a subtype of entities C, D and E,
      // and entity B is a subtype of entities C, E and F,
      // then the count returned by the following application
      // of getInstanceCount will include all instances of both A and B.
    int A_and_B_and_other = m.getInstanceCount(types);

Parameters:
types - an array of definitions of simple entity data types.
Returns:
the number of instances of those entities which contain specified simple entity data types.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
See Also:
getInstanceCount(), getInstanceCount(EEntity_definition type), getInstanceCount(Class type), getInstanceCount(Class types[]), getExactInstanceCount(EEntity_definition type), getExactInstanceCount(Class type), getExactInstanceCount(EEntity_definition types[]), getInstances(EEntity_definition types[])

getInstanceCount

public int getInstanceCount(java.lang.Class[] types)
                     throws SdaiException
Returns the total number of instances of those entities which contain specified simple entity data types. Only instances contained in this model are counted. An array of classes representing simple entity data types is passed through the parameter of this method. Each element in this array shall be in the form CXxx.class, where xxx is the name of the entity. The number of entity data types 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. If null value is passed to the method's parameter, then SdaiException VA_NSET is thrown.

Example:

    SdaiModel m = ...;
    Class [] types = new Class[5];
    types[0] = CC.class; // class for entity C
    types[1] = CE.class; // class for entity E
    types[2] = null;
      // If, for example, entity A is a subtype of entities C, D and E,
      // and entity B is a subtype of entities C, E and F,
      // then the count returned by the following application
      // of getInstanceCount will include all instances of both A and B.
    int A_and_B_and_other = m.getInstanceCount(types);

Parameters:
types - an array of classes representing simple entity data types.
Returns:
the number of instances of those entities which contain specified simple entity data types.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - VA_NSET, value not set.
See Also:
getInstanceCount(), getInstanceCount(EEntity_definition type), getInstanceCount(Class type), getInstanceCount(EEntity_definition types[]), getExactInstanceCount(EEntity_definition type), getExactInstanceCount(Class type), getExactInstanceCount(EEntity_definition types[]), getInstances(Class types[])

getExactInstanceCount

public int getExactInstanceCount(jsdai.dictionary.EEntity_definition type)
                          throws SdaiException
Returns the number of instances of the specified entity data type within this model. The instances of any of its subtypes are not counted. The given entity data type must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, SdaiException ED_NVLD is thrown. Passing null value to the method's parameter results in SdaiException ED_NDEF.

Parameters:
type - definition of the entity of which the instance count is required.
Returns:
the number of instances of the specified entity data type.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
See Also:
getInstanceCount(), getInstanceCount(EEntity_definition type), getInstanceCount(Class type), getInstanceCount(EEntity_definition types[]), getInstanceCount(Class types[]), getExactInstanceCount(Class type), getExactInstanceCount(EEntity_definition types[]), getExactInstances(EEntity_definition type)

getExactInstanceCount

public int getExactInstanceCount(java.lang.Class type)
                          throws SdaiException
Returns the number of instances of the specified entity data type within this model. The instances of any of its subtypes are not counted. The given entity data type (represented by the method's parameter) must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, that is, if the parameter passed to this method does not allow to identify an entity that is known for this schema, then SdaiException ED_NDEF is thrown. A value passed to the parameter should be in the form CXxx.class, where xxx is the name of the entity. Passing null value to the method's parameter results in SdaiException VA_NSET.

Parameters:
type - Java class for the entity of which the instance count is required.
Returns:
the number of instances of the specified entity data type.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
See Also:
getInstanceCount(), getInstanceCount(EEntity_definition type), getInstanceCount(Class type), getInstanceCount(EEntity_definition types[]), getInstanceCount(Class types[]), getExactInstanceCount(EEntity_definition type), getExactInstanceCount(EEntity_definition types[]), getExactInstances(Class type)

getExactInstanceCount

public int getExactInstanceCount(jsdai.dictionary.EEntity_definition[] types)
                          throws SdaiException
Returns the number of instances of the entity consisting of the specified simple entity data types. Only instances contained in this model are counted. An array of definitions of simple entity data types is passed through the parameter of this method. The number of entity data types 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. If null value is passed to the method's parameter, then SdaiException ED_NDEF is thrown.

Parameters:
types - an array of definitions of simple entity data types.
Returns:
the number of instances of the entity consisting of the specified simple entity data types.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NDEF, SdaiModel access not defined.
SdaiException - ED_NDEF, entity definition not defined.
See Also:
getInstanceCount(), getInstanceCount(EEntity_definition type), getInstanceCount(Class type), getInstanceCount(EEntity_definition types[]), getInstanceCount(Class types[]), getExactInstanceCount(EEntity_definition type), getExactInstanceCount(Class type)

copyInstance

public EEntity copyInstance(EEntity source)
                     throws SdaiException
Makes a copy of the specified instance and puts this copy into the contents of this model. The copy is, in addition, returned by this method. The values for all attributes of the copy are taken from the original instance similarly as in copyApplicationInstance method.

The entity data type of the original instance must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, SdaiException ED_NVLD is thrown. Passing null value to the method's parameter results in SdaiException VA_NSET. The method is not applicable to models from "System Repository". Moreover, no instance from the models of "System Repository" can be copied to any model from any repository. In both these cases SdaiException FN_NAVL is thrown.

This method is an extension of JSDAI, which is not a part of the standard.

Parameters:
source - the given entity instance.
Returns:
a copy of the given entity instance.
Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NRW, transaction not read-write.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NRW, SDAI-model access not read-write.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
SdaiException - FN_NAVL, function not available.
SdaiException - SY_ERR, underlying system error.
See Also:
copyInstances(jsdai.lang.AEntity)

copyInstances

public AEntity copyInstances(AEntity source)
                      throws SdaiException
Makes a copy of all instances from the specified aggregate to this model. The copies of the instances are also collected into a new aggregate which is returned by this method. References between instances of the given aggregate are mapped to references between their copies. Other values for attributes of the newly created copies are taken from the original instances similarly as in copyApplicationInstance method.

The entity data type of each original instance must be defined or declared in the EXPRESS schema whose definition is underlying for this model. Otherwise, SdaiException ED_NVLD is thrown. Passing null value to the method's parameter results in SdaiException VA_NSET. The method is not applicable to models from "System Repository". Moreover, no instance from the models of "System Repository" can be copied to any model from any repository. In both these cases SdaiException FN_NAVL is thrown.

This method is an extension of JSDAI, which is not a part of the standard.

Example:

    SdaiModel m = ...;
    SdaiModel m_source = ...;
    AEntity source = m_source.getInstances(ECartesian_point.class);
    AEntity res_aggr = m.copyInstances(source);

Parameters:
source - the aggregate of entity instances.
Returns:
the aggregate of copies of the specified entity instances.
Throws:
SdaiException - TR_NEXS, transaction does not exist.
SdaiException - TR_NRW, transaction not read-write.
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - MX_NRW, SDAI-model access not read-write.
SdaiException - ED_NVLD, entity definition invalid.
SdaiException - VA_NSET, value not set.
SdaiException - FN_NAVL, function not available.
SdaiException - SY_ERR, underlying system error.
See Also:
copyInstance(jsdai.lang.EEntity)

toString

public java.lang.String toString()
Returns a description of this model as a String. It includes constant string "SdaiModel: " and the name of the model.

Returns:
a description of the model.

getEntityExtentInstances

public AEntity getEntityExtentInstances(jsdai.dictionary.EEntity_definition entity_definition)
                                 throws SdaiException
Deprecated, use getInstances(EEntity_definition type) instead.

Throws:
SdaiException

getEntityExtentInstances

public AEntity getEntityExtentInstances(java.lang.Class provided_class)
                                 throws SdaiException
Deprecated, use getInstances(Class type) instead.

Throws:
SdaiException

create

public EEntity create(ComplexEntityValue values)
               throws SdaiException
This method is for internal JSDAI use only. Applications shall not use it.

Throws:
SdaiException

exportXml

public void exportXml(java.io.OutputStream location,
                      InstanceReader instanceReader)
               throws SdaiException
Writes this model in XML representation to specified stream. Output format is controlled by instanceReader parameter.

Parameters:
location - an OutputStream to write XML to
instanceReader - an InstanceReader describing output format
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
jsdai.xml.InstanceReader, jsdai.xml.LateBindingReader

getLocationURL

public java.net.URL getLocationURL()
                            throws SdaiException
Returns model location as a URL.

The models can be stored in repository directory or in SDAI file.

Returns:
the location as URL of this SdaiModel.
Throws:
SdaiException - MO_NEXS, SdaiModel does not exist.

getEntityDefinitionByRef

public jsdai.dictionary.EEntity_definition getEntityDefinitionByRef(jsdai.query.SerializableRef entityRef)
                                                             throws SdaiException
Returns entity definition for the entity referenced by specified SerializableRef. This method searches the set of entities that are encountered in the EXPRESS schema whose definition is underlying for this model. If this parameter does not allow to identify an entity that is known for this schema, then SdaiException ED_NDEF is thrown. Passing null value to the method's parameter results in SdaiException VA_NSET.

Parameters:
entityRef - SerializableRef used to refer to remote entity instance. entityRef.getTypeIndex() should return positive value otherwise SdaiException ED_NDEF is thrown.
Returns:
definition of the specified entity.
Throws:
SdaiException - MO_NEXS, SDAI-model does not exist.
SdaiException - ED_NDEF, entity definition not defined.
SdaiException - VA_NSET, value not set.
SdaiException - SY_ERR, underlying system error.
See Also:
getEntityDefinition(java.lang.String)

connectInConnector

public void connectInConnector(jsdai.lang.SdaiModel.Connector connector)
Description copied from interface: SdaiModelConnector
Connects connector to the incomming connector ring. This method is intended for internal use only.

Specified by:
connectInConnector in interface SdaiModelConnector
Parameters:
connector - a connector to connect.
Since:
4.0.0

disconnectInConnector

public void disconnectInConnector(jsdai.lang.SdaiModel.Connector connector)
Description copied from interface: SdaiModelConnector
Disconnects connector from the incomming connector ring. This method is intended for internal use only.

Specified by:
disconnectInConnector in interface SdaiModelConnector
Parameters:
connector - a connector to disconnect.
Since:
4.0.0

resolveConnectedModel

public SdaiModel resolveConnectedModel()
Description copied from interface: SdaiModelConnector
Resolve to connected SdaiModel. This method is intended for internal use only.

Specified by:
resolveConnectedModel in interface SdaiModelConnector
Returns:
resolved SdaiModel
Since:
4.0.0

Copyright © LKSoftWare GmbH, 1999-2008