com.corticon.eclipse.studio.vocabulary.core

## Interface IDatabaseMappingAPI

- All Superinterfaces:
    IModelAPI

      public interface IDatabaseMappingAPI
      extends IModelAPI

  Database Mapping API implementation. This class contains methods that support Vocabulary-to-database "smart mapping" by leveraging database metadata.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IAssociationEnd` | `getAssociationEndFromPrimaryKeyColumnName(IEntity aIEntity, java.lang.String astrColumnName)` Given an IEntity instance and a database column name, use database metadata in an brute-force effort to locate the matching IAssociationEnd instance, if any.
    `IAttribute` | `getAttributeFromPrimaryKeyColumnName(IEntity aIEntity, java.lang.String astrColumnName)` Given an IEntity instance and a database column name (part of primary key), use database metadata in a brute-force effort to locate the matching IAttribute, if any.
    `java.lang.String` | `getColumnNameForAttribute(IAttribute aIAttribute)` Return database column name corresponding to a given attribute.
    `java.lang.String` | `getColumnNameSmartMatch(IAttribute aIAttribute)` Given an attribute, determine the best matching column name from the metadata if available.
    `java.lang.String` | `getDatastoreIdentityColumnName(IEntity aIEntity)` Given an entity, returns the datastore identity column name if specified, or a default name if none is specified.
    `java.lang.String` | `getDatastoreIdentitySequence(IEntity aIEntity)` Given an entity, returns the datastore identity sequence name if specified, or a default name if none is specified.
    `java.lang.String` | `getDatastoreIdentitySequenceNameColumnName(IEntity aIEntity)` Given an entity, returns the datastore identity sequence name column name if specified, or a default name if none is specified.
    `java.lang.String` | `getDatastoreIdentitySequenceNextvalColumnName(IEntity aIEntity)` Given an entity, returns the datastore identity sequence nextval column name if specified, or a default name if none is specified.
    `java.lang.String` | `getDatastoreIdentitySequenceTableName(IEntity aIEntity)` Given an entity, returns the datastore identity sequence table name if specified, or a default name if none is specified.
    `java.lang.String` | `getDatastoreIdentityStrategy(IEntity aIEntity)` Given an entity, returns the datastore identity strategy if specified, or a default name if none is specified.
    `java.util.List` | `getEntityIdentityForEntity(IEntity aIEntity)` Given an entity, return the effective Entity Identity set taking into account a user specified value or a default derived from database metadata.
    `java.util.List` | `getEntityIdentitySmartMatch(IEntity aIEntity)` Infer and return the entity identity from database metadata for the specified IEntity instance.
    `java.lang.String` | `getJoinExpression(IAssociationEnd aIAssociationEnd)` Return the "smart matching" join expression for the given association end.
    `java.util.List` | `getJoinExpressions(IAssociationEnd aIAssociationEnd)` Get all valid join expressions for a given association end from database metadata.
    `java.lang.String` | `getTableNameForEntity(IEntity aIEntity)` Return the "best matching" fully-qualified table name for a given entity considering the entity, the class name and the table name (if explicitly specified).
    `java.lang.String` | `getTableNameSmartMatch(IEntity aIEntity)` Given an entity, determine the best matching table name from the metadata if available.
    `java.lang.String` | `getValueStrategy(IAttribute aIAttribute)` Given an attribute, returns the value strategy name if specified, or a default name if none is specified.
    `java.lang.String` | `getValueStrategySequence(IAttribute aIAttribute)` Given an attribute, returns the value strategy sequence name if specified, or a default name if none is specified.
    `java.lang.String` | `getValueStrategySequenceNameColumnName(IAttribute aIAttribute)` Given an attribute, returns the value strategy sequence name column name if specified, or a default name if none is specified.
    `java.lang.String` | `getValueStrategySequenceNextvalColumnName(IAttribute aIAttribute)` Given an attribute, returns the value strategy sequence nextval column name if specified, or a default name if none is specified.
    `java.lang.String` | `getValueStrategySequenceTableName(IAttribute aIAttribute)` Given an attribute, returns the value strategy sequence table name if specified, or a default name if none is specified.
    `java.lang.String` | `getVersionColumn(IEntity aIEntity)` Given an entity, returns the version column name if specified, or a default name if none is specified.
    `boolean` | `isTable(IEntity aIEntity)` Determine whether the specified entity is mapped to a database table.
    `boolean` | `isView(IEntity aIEntity)` Determine whether the specified entity is mapped to a database view.
    `void` | `setVocabularyModelAPI(IVocabularyModelAPI aIVocabularyModelAPI)` Setter for reference to Vocabulary model API (required).

    - ### Methods inherited from interface com.corticon.eclipse.core.IModelAPI

      `activate, addAnnotation, addBatchedModelListener, addLowLevelModelListener, addModelListener, addResourceListener, addView, beginTransaction, cancelTransaction, canSetSupportedLocales, closeResource, createResource, deleteAnnotation, deleteAnnotation, deleteAnnotation, deleteResource, displayMessageBox, dispose, doPostLoadValidation, doSmartValidation, endTransaction, endTransaction, flushCommandStack, formatValidationMessageLocation, formatValidationMessageText, getAllLocalesProvidingCompleteLocalization, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAPIContextObject, getAsset, getBaseAttribute, getBaseAttributeString, getBatchedModelListeners, getBuildNumber, getBuildNumberOfLastValidationRulesChange, getEditingDomain, getErrors, getErrors, getIndexByLocale, getLocale, getLocalizedAttribute, getLocalizedAttributeString, getLowLevelModelListeners, getMajorServiceNumber, getMajorVersionNumber, getMessage, getMessage, getMessageBase, getMessageBoxDelegate, getMinorServiceNumber, getMinorVersionNumber, getModelAPIState, getModelListeners, getNewResourceName, getPersistenceServicesDelegate, getPreferences, getPrimaryResource, getPrimaryResourceURI, getScrollableMessageDelegate, getSupportedLocales, getSuppressBrokenLinkValidation, getSuppressValidation, getToolTip, getUpdateStamp, getUserInterfaceInfoDelegate, getValidationMessageCount, getValidationMessageCount, getValidationMessageCount, getValidationMessageCount, getValidationMessages, getValidationMessages, getWarnings, getWarnings, handleException, hasErrors, hasErrors, hasErrors, hasErrors, hasErrors, hasErrors, hasErrorsOrWarnings, hasErrorsOrWarnings, hasErrorsOrWarnings, hasErrorsOrWarnings, hasErrorsOrWarnings, hasErrorsOrWarnings, hasWarnings, hasWarnings, hasWarnings, hasWarnings, hasWarnings, hasWarnings, isAPIStateEstablished, isEnabledRedo, isEnabledUndo, isInhibitNotification, isLoaded, isOperationModeNormal, isOperationModeRedo, isOperationModeUndo, isPassive, isPostLoadInProgress, isPrimaryResourceSet, isReadOnly, isResourceActivated, isResourceConflict, isResourceDemandLoaded, isResourceLoaded, isScrollableMessageDelegateAvailable, isShowCanonicalValidationMessages, isSuppressModifiedFlagUpdates, isSuppressPostLoad, isTransactionInProgress, isValid, isValid, loadResource, loadResource, loadResource, newInstance, noOperation, postLoad, postMethod, postMethod, postsave, preMethod, presave, redo, reloadResource, remapResource, remapResource, removeBatchedModelListener, removeLowLevelModelListener, removeModelListener, removeResource, removeResourceListener, removeView, renameResource, rollbackTransaction, saveAll, saveResource, setAnnotation, setAPIContextObject, setAPIState, setBuildNumber, setEditingDomain, setInhibitNotification, setLocale, setMajorServiceNumber, setMajorVersionNumber, setMessageBoxDelegate, setMinorServiceNumber, setMinorVersionNumber, setModelAPIState, setModelListeners, setPassive, setPersistenceServicesDelegate, setPostLoadInProgress, setPreferencesDelegate, setPrimaryResource, setReadOnly, setScrollableMessageDelegate, setSupportedLocales, setSuppressBrokenLinkValidation, setSuppressModifiedFlagUpdates, setSuppressPostLoad, setSuppressValidation, setUserInterfaceInfoDelegate, undo, unloadResource, validate, validateLicense`

- - ### Method Detail

    - #### getAssociationEndFromPrimaryKeyColumnName

          IAssociationEnd getAssociationEndFromPrimaryKeyColumnName(IEntity aIEntity,
                                                                  java.lang.String astrColumnName)

      Given an IEntity instance and a database column name, use database metadata in an brute-force effort to locate the matching IAssociationEnd instance, if any. This function can be used to determine the proper association end for a compound-identity column.
      Parameters:
        `aIEntity` - Entity reference.
        `astrColumnName` - Database column name.
      Returns:
        IAssociationEnd instance or `null` if no match could be found.

    - #### getAttributeFromPrimaryKeyColumnName

          IAttribute getAttributeFromPrimaryKeyColumnName(IEntity aIEntity,
                                                        java.lang.String astrColumnName)

      Given an IEntity instance and a database column name (part of primary key), use database metadata in a brute-force effort to locate the matching IAttribute, if any.
      Parameters:
        `aIEntity` - Reference to entity.
        `astrColumnName` - Database column name.
      Returns:
        IAttribute instance or `null` if no matching attribute could be found.

    - #### getColumnNameForAttribute

          java.lang.String getColumnNameForAttribute(IAttribute aIAttribute)

      Return database column name corresponding to a given attribute. The column name returned will be that explicitly specified by the user, or a best match located in database metadata, if available.
      Parameters:
        `IAttribute` - Attribute instance.
      Returns:
        Best matching database column name or `null` if column name could not be determined.

    - #### getColumnNameSmartMatch

          java.lang.String getColumnNameSmartMatch(IAttribute aIAttribute)

      Given an attribute, determine the best matching column name from the metadata if available. If no matching name can be determined, return `null`.
      Parameters:
        `aIAttribute` - Attribute instance.
      Returns:
        Best matching column name or `null`.

    - #### getDatastoreIdentityColumnName

          java.lang.String getDatastoreIdentityColumnName(IEntity aIEntity)

      Given an entity, returns the datastore identity column name if specified, or a default name if none is specified. The default datastore identity column name is derived from the primary key information expressed in the database metadata.
      Parameters:
        `aIEntity` - Entity reference.
      Returns:
        Datastore identity column name or `null`.

    - #### getEntityIdentityForEntity

          java.util.List getEntityIdentityForEntity(IEntity aIEntity)

      Given an entity, return the effective Entity Identity set taking into account a user specified value or a default derived from database metadata. If a specific value is not specified and no database metadata is available, this method will return `null`.
      Parameters:
        `aIEntity` - Reference to entity.
      Returns:
        Entity identity list consisting of IAttribute and IAssociationEnd instances.

    - #### getDatastoreIdentitySequenceTableName

          java.lang.String getDatastoreIdentitySequenceTableName(IEntity aIEntity)

      Given an entity, returns the datastore identity sequence table name if specified, or a default name if none is specified.
      Parameters:
        `aIEntity` - Entity reference.
      Returns:
        Sequence table name or `null`.

    - #### getDatastoreIdentitySequenceNameColumnName

          java.lang.String getDatastoreIdentitySequenceNameColumnName(IEntity aIEntity)

      Given an entity, returns the datastore identity sequence name column name if specified, or a default name if none is specified.
      Parameters:
        `aIEntity` - Entity reference.
      Returns:
        Sequence name column name or `null`.

    - #### getDatastoreIdentitySequenceNextvalColumnName

          java.lang.String getDatastoreIdentitySequenceNextvalColumnName(IEntity aIEntity)

      Given an entity, returns the datastore identity sequence nextval column name if specified, or a default name if none is specified.
      Parameters:
        `aIEntity` - Entity reference.
      Returns:
        Sequence nextval column name or `null`.

    - #### getValueStrategySequenceTableName

          java.lang.String getValueStrategySequenceTableName(IAttribute aIAttribute)

      Given an attribute, returns the value strategy sequence table name if specified, or a default name if none is specified.
      Parameters:
        `aIAttribute` - Attribute reference.
      Returns:
        Sequence table name or `null`.

    - #### getValueStrategySequenceNameColumnName

          java.lang.String getValueStrategySequenceNameColumnName(IAttribute aIAttribute)

      Given an attribute, returns the value strategy sequence name column name if specified, or a default name if none is specified.
      Parameters:
        `aIAttribute` - Attribute reference.
      Returns:
        Sequence name column name or `null`.

    - #### getValueStrategySequenceNextvalColumnName

          java.lang.String getValueStrategySequenceNextvalColumnName(IAttribute aIAttribute)

      Given an attribute, returns the value strategy sequence nextval column name if specified, or a default name if none is specified.
      Parameters:
        `aIAttribute` - Attribute reference.
      Returns:
        Sequence nextval column name or `null`.

    - #### getEntityIdentitySmartMatch

          java.util.List getEntityIdentitySmartMatch(IEntity aIEntity)

      Infer and return the entity identity from database metadata for the specified IEntity instance. If the identity cannot be inferred, this method will return `null`.
      Parameters:
        `aIEntity` - Reference to entity.
      Returns:
        Entity identity list consisting of IAttribute and IAssociationEnd instances.

    - #### getJoinExpression

          java.lang.String getJoinExpression(IAssociationEnd aIAssociationEnd)

      Return the "smart matching" join expression for the given association end. The returned value will be either (1) a join expression explicitly entered by the user or (2) a single join expression culled from the database metadata. If more than one applicable join expression is discovered, no default can be established since the result is ambiguous; in such cases, this method will return `null`.
      Parameters:
        `aIAssociationEnd` - IAssociationEnd instance.
      Returns:
        Best matching join expression or `null` if none could be ascertained.

    - #### getJoinExpressions

          java.util.List getJoinExpressions(IAssociationEnd aIAssociationEnd)

      Get all valid join expressions for a given association end from database metadata. The returned list can be used to construct a list of all possible choices (e.g., to populate a combo box).
      Parameters:
        `aIAssociationEnd` - IAssociationEnd instance.
      Returns:
        List of valid join expressions (empty if no join expressions cannot be ascertained).

    - #### getTableNameForEntity

          java.lang.String getTableNameForEntity(IEntity aIEntity)

      Return the "best matching" fully-qualified table name for a given entity considering the entity, the class name and the table name (if explicitly specified).
      Parameters:
        `aIEntity` - Reference to entity.
      Returns:
        Best matching fully-qualified database table name.

    - #### getTableNameSmartMatch

          java.lang.String getTableNameSmartMatch(IEntity aIEntity)

      Given an entity, determine the best matching table name from the metadata if available. If no matching name can be determined, return `null`.
      Parameters:
        `aIEntity` - Reference to entity.
      Returns:
        Best matching fully-qualified table name or `null`.

    - #### isTable

          boolean isTable(IEntity aIEntity)

      Determine whether the specified entity is mapped to a database table.
      Parameters:
        `aIEntity` - Entity to test.
      Returns:
        `true` if entity is mapped to a table.

    - #### isView

          boolean isView(IEntity aIEntity)

      Determine whether the specified entity is mapped to a database view.
      Parameters:
        `aIEntity` - Entity to test.
      Returns:
        `true` if entity is mapped to a view.

    - #### setVocabularyModelAPI

          void setVocabularyModelAPI(IVocabularyModelAPI aIVocabularyModelAPI)

      Setter for reference to Vocabulary model API (required).
      Parameters:
        `aIVocabularyModelAPI` - Vocabulary model API instance.

    - #### getVersionColumn

          java.lang.String getVersionColumn(IEntity aIEntity)

      Given an entity, returns the version column name if specified, or a default name if none is specified.
      Parameters:
        `aIEntity` - Entity reference.
      Returns:
        Version column name or `null`.

    - #### getDatastoreIdentitySequence

          java.lang.String getDatastoreIdentitySequence(IEntity aIEntity)

      Given an entity, returns the datastore identity sequence name if specified, or a default name if none is specified.
      Parameters:
        `aIEntity` - Entity reference.
      Returns:
        Sequence name or `null`.

    - #### getValueStrategySequence

          java.lang.String getValueStrategySequence(IAttribute aIAttribute)

      Given an attribute, returns the value strategy sequence name if specified, or a default name if none is specified.
      Parameters:
        `aIAttribute` - Attribute reference.
      Returns:
        Sequence name or `null`.

    - #### getDatastoreIdentityStrategy

          java.lang.String getDatastoreIdentityStrategy(IEntity aIEntity)

      Given an entity, returns the datastore identity strategy if specified, or a default name if none is specified.
      Parameters:
        `aIEntity` - Entity reference.
      Returns:
        Identity strategy name or `null`.

    - #### getValueStrategy

          java.lang.String getValueStrategy(IAttribute aIAttribute)

      Given an attribute, returns the value strategy name if specified, or a default name if none is specified.
      Parameters:
        `aIAttribute` - Attribute reference.
      Returns:
        Value strategy name or `null`.

Copyright © 2005-2013 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.