To be completed (add example)
To increase search speed in the database, it is possible to define persistent hash tables. A hash table is a persistent data structure in the database that speeds up the search for instances of one entity in one schema via the value of one attribute. The hash table is created when a data model of the specified schema is created and it is maintained during the entire lifetime of the model or until it is deleted. If there exist a data model based on the specified schema when the hash table is defined, this model do not get a hash table. In this case the model must be exported to a STEP file, deleted and recreated from the STEP file. Likewise is not an attribute hash table of data model removed if the attribute hash table definition is removed from the underlying schema of the data model.
This function defines attribute hash table connected to the specified attribute in the specified schema.
Related function: edmiRemoteDefinePersistentAttrHashTable.
The search in hash tables is done explicitly by the following edmi functions: edmiRemoteGetHashedAttrInstance, edmiRemoteGetHashedAttrInstanceBN, edmiRemoteGetHashedAttrInstances, edmiRemoteGetHashedAttrInstancesBN, edmiGetHashedAttrInstance, edmiGetHashedAttrInstanceBN, edmiGetHashedAttrInstances and edmiGetHashedAttrInstancesBN
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteDefinePersistentAttrHashTableBN(SdaiServerContext serverContextId, SdaiString schemaName, SdaiString entityName, SdaiString attributeName, SdaiOptions options, SdaiInteger hashTableWidth, SdaiInteger attrStringLength, SdaiInvocationId *edmiInvocationId);
Arguments:
serverContextId |
Context identification, from edmiDefineServerContext |
schemaName |
The name of the Express Schema in the remote EDMdatabase in which the attribute is defined. |
entityName |
The name of the entity in which the attribute is defined. |
attributeName |
The name of the attribute for which the persistent hash table is defined. |
options |
See description of available options below. |
hashTableWidth |
Optional. Curenntly not implemented. In bits. |
attrStringLength |
Optional. String length for FIXED_STRING_LENGTH, |
*edmiInvocationId |
Currently not used. |
Options: Descriptions:
MULTIPLE_ATTRIBUTES |
Only for EDM internal usage |
MULTIPLE_ENTITIES |
Only for EDM internal usage |
ALL_ATTR_OCCURENCES |
Only for EDM internal usage |
DELETE_ATTR_HASH |
The existing hash table of the specified attribute is deleted. No new hash table is defined. |
REDEFINE_ATTR_HASH |
The existing hash table of the specified attribute is deleted and a new hash table is defined. |
SUBTYPES |
Specifies that in addition to all instances of the type specified by the <entityId> argument, all subtype instances of the specified type should be queried as well. |
FIXED_STRING_LENGTH |
The argument <Attribute (fixed) string length> is taken as the fixed string length of the attribute. |
UNIQUE_ATTR_VALUES |
EDM checks that the attribute is unique when a new instance is stored or an attribute is modified. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
Example:
EdmiError rstat;