com.metamatrix.modeler.transformation.metadata
Class TransformationMetadata

java.lang.Object
  extended by com.metamatrix.query.metadata.BasicQueryMetadata
      extended by com.metamatrix.modeler.transformation.metadata.TransformationMetadata
All Implemented Interfaces:
QueryMetadataInterface
Direct Known Subclasses:
ServerRuntimeMetadata

public abstract class TransformationMetadata
extends BasicQueryMetadata

Modelers implementation of QueryMetadataInterface that reads columns, groups, models etc. index files for various metadata properties.


Field Summary
static ColumnRecordComparator columnComparator
           
static char DELIMITER_CHAR
          Delimiter character used when specifying fully qualified entity names
static java.lang.String DELIMITER_STRING
           
static java.lang.String NOT_EXISTS_MESSAGE
           
 
Fields inherited from interface com.metamatrix.query.metadata.QueryMetadataInterface
UNKNOWN_CARDINALITY
 
Constructor Summary
protected TransformationMetadata(QueryMetadataContext context)
          TransformationMetadata constructor
 
Method Summary
 boolean elementSupports(java.lang.Object elementID, int elementConstant)
           
protected  void filterMetadataRecordForUUID(java.lang.String uuid, java.util.Collection records)
          Remove any MetadataRecord instances that do not match the specified uuid Due to the pattern matching used to query index files if an index record matched the specified uuid string anywhere in that record it would be returned in the results (for example, if the parent ObjectID in the index record matched the specified uuid).
protected  java.util.Collection findChildRecords(MetadataRecord parentRecord, char childRecordType)
          Return all index file records that match the specified entity name, filtering by matching on parent uuid
protected  java.util.Collection findChildRecordsForColumns(MetadataRecord parentRecord, char childRecordType, java.util.List uuids)
          Return all index file records that match the specified entity name, filtering by matching on the child uuids
protected  java.util.Collection findChildRecordsWithoutFiltering(MetadataRecord parentRecord, char childRecordType)
          Return all index file records that match the specified entity name, without filtering
protected  MetadataRecord findMetadataRecord(IEntryResult result)
           
protected  java.util.Collection findMetadataRecords(char recordType, java.lang.String entityName, boolean isPartialName)
          Return all index file records that match the specified entity name
protected  java.util.Collection findMetadataRecords(IEntryResult[] results)
          Return all index file records that match the specified entity name
 java.util.Collection getAccessPatternsInGroup(java.lang.Object groupID)
           
 byte[] getBinaryVDBResource(java.lang.String resourcePath)
           
 int getCardinality(java.lang.Object groupID)
           
 java.lang.String getCharacterVDBResource(java.lang.String resourcePath)
           
protected  QueryMetadataContext getContext()
          Return the QueryMetadataContext reference
protected  DatatypeRecord getDatatypeRecord(java.lang.Object elementID)
           
protected  java.lang.String getDatatypeUUIDMatchPattern(java.lang.String uuid)
          Return the pattern match string that could be used to match a UUID in a datatype index record.
 java.lang.Object getDefaultValue(java.lang.Object elementID)
           
 java.lang.String getDeletePlan(java.lang.Object groupID)
           
 int getDistinctValues(java.lang.Object elementID)
           
 java.lang.Object getElementID(java.lang.String elementName)
           
 java.util.List getElementIDsInAccessPattern(java.lang.Object accessPattern)
           
 java.util.List getElementIDsInGroupID(java.lang.Object groupID)
           
 java.util.List getElementIDsInIndex(java.lang.Object index)
           
 java.util.List getElementIDsInKey(java.lang.Object key)
           
 int getElementLength(java.lang.Object elementID)
           
 java.lang.String getElementType(java.lang.Object elementID)
           
 java.util.Properties getExtensionProperties(java.lang.Object metadataID)
           
 java.util.Collection getForeignKeysInGroup(java.lang.Object groupID)
           
 java.lang.String getFormat(java.lang.Object elementID)
           
 java.lang.String getFullElementName(java.lang.String fullGroupName, java.lang.String shortElementName)
           
 java.lang.String getFullName(java.lang.Object metadataID)
           
 java.lang.Object getGroupID(java.lang.String groupName)
           
 java.lang.Object getGroupIDForElementID(java.lang.Object elementID)
           
 java.lang.String getGroupName(java.lang.String fullElementName)
          Return the text portion of the fullElementName representing a group.
 java.util.Collection getGroupsForPartialName(java.lang.String partialGroupName)
           
protected  com.metamatrix.internal.core.index.Index[] getIndexes(char recordType, IndexSelector selector)
          Return the array of MtkIndex instances representing temporary indexes
 java.util.Collection getIndexesInGroup(java.lang.Object groupID)
           
protected  IndexSelector getIndexSelector()
          Return the IndexSelector reference
 java.lang.String getInsertPlan(java.lang.Object groupID)
           
 MappingNode getMappingNode(java.lang.Object groupID)
           
protected  java.lang.String getMatchPattern(char recordType, java.lang.String name)
          Return the pattern match string that could be used to match a partially/fully qualified entity name in an index record.
 java.lang.Object getMaterialization(java.lang.Object groupID)
           
 java.lang.Object getMaterializationStage(java.lang.Object groupID)
           
 java.lang.Object getMaximumValue(java.lang.Object elementID)
           
 int getMaxSetSize(java.lang.Object modelID)
           
 java.lang.Object getMinimumValue(java.lang.Object elementID)
           
 java.lang.String getModeledBaseType(java.lang.Object elementID)
           
 java.lang.String getModeledPrimitiveType(java.lang.Object elementID)
           
 java.lang.String getModeledType(java.lang.Object elementID)
           
 java.lang.Object getModelID(java.lang.Object groupOrElementID)
           
 java.lang.String getNameInSource(java.lang.Object metadataID)
           
 java.lang.String getNativeType(java.lang.Object elementID)
           
 int getNullValues(java.lang.Object elementID)
           
protected  java.lang.String getParentPrefixPattern(char recordType, java.lang.String name)
          Return the prefix match string that could be used to exactly match a fully qualified entity name in an index record.
 int getPosition(java.lang.Object elementID)
           
 int getPrecision(java.lang.Object elementID)
           
protected  java.lang.String getPrefixPattern(char recordType, java.lang.String name)
          Return the prefix match string that could be used to exactly match a fully qualified entity name in an index record.
 java.lang.Object getPrimaryKeyIDForForeignKeyID(java.lang.Object foreignKeyID)
           
 int getRadix(java.lang.Object elementID)
           
protected  MetadataRecord getRecordByType(java.lang.String entityName, char recordType)
          Get a MetadataRecord object given a entityName/UUID.
 int getScale(java.lang.Object elementID)
           
 java.lang.String getShortElementName(java.lang.String fullElementName)
           
 StoredProcedureInfo getStoredProcedureInfoForProcedure(java.lang.String fullyQualifiedProcedureName)
           
 java.util.Collection getUniqueKeysInGroup(java.lang.Object groupID)
           
 java.lang.String getUpdatePlan(java.lang.Object groupID)
           
protected  java.lang.String getUUIDMatchPattern(char recordType, java.lang.String uuid)
          Return the pattern match string that could be used to match a UUID in an index record.
protected  java.lang.String getUUIDPrefixPattern(char recordType, java.lang.String uuid)
          Return the prefix match string that could be used to exactly match a uuid in an index record.
 java.lang.String[] getVDBResourcePaths()
           
 java.lang.String getVirtualDatabaseName()
           
 QueryNode getVirtualPlan(java.lang.Object groupID)
           
 java.util.List getXMLSchemas(java.lang.Object groupID)
           
 java.util.Collection getXMLTempGroups(java.lang.Object groupID)
           
 boolean groupSupports(java.lang.Object groupID, int groupConstant)
           
 boolean hasMaterialization(java.lang.Object groupID)
           
 boolean isProcedure(java.lang.Object groupID)
           
 boolean isTemporaryGroup(java.lang.Object groupID)
           
 boolean isVirtualGroup(java.lang.Object groupID)
           
 boolean isVirtualModel(java.lang.Object modelID)
           
 boolean isXMLGroup(java.lang.Object groupID)
           
 boolean modelSupports(java.lang.Object modelID, int modelConstant)
           
protected  IEntryResult[] queryIndex(char recordType, java.lang.String entityName, boolean isPartialName)
          Return all index file records that match the specified entity name
protected  IEntryResult[] queryIndex(com.metamatrix.internal.core.index.Index[] indexes, char[] pattern, boolean isPrefix, boolean returnFirstMatch)
          Return all index file records that match the specified record pattern.
protected  IEntryResult[] queryIndex(com.metamatrix.internal.core.index.Index[] indexes, char[] pattern, boolean isPrefix, boolean isCaseSensitive, boolean returnFirstMatch)
          Return all index file records that match the specified record pattern.
 
Methods inherited from class com.metamatrix.query.metadata.BasicQueryMetadata
addToMetadataCache, getFromMetadataCache, isScalarGroup, isTemporaryTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITER_CHAR

public static final char DELIMITER_CHAR
Delimiter character used when specifying fully qualified entity names

See Also:
Constant Field Values

DELIMITER_STRING

public static final java.lang.String DELIMITER_STRING
See Also:
Constant Field Values

columnComparator

public static ColumnRecordComparator columnComparator

NOT_EXISTS_MESSAGE

public static java.lang.String NOT_EXISTS_MESSAGE
Constructor Detail

TransformationMetadata

protected TransformationMetadata(QueryMetadataContext context)
TransformationMetadata constructor

Parameters:
context - Object containing the info needed to lookup metadta.
Method Detail

getElementID

public java.lang.Object getElementID(java.lang.String elementName)
                              throws MetaMatrixComponentException,
                                     QueryMetadataException
Specified by:
getElementID in interface QueryMetadataInterface
Overrides:
getElementID in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getGroupID

public java.lang.Object getGroupID(java.lang.String groupName)
                            throws MetaMatrixComponentException,
                                   QueryMetadataException
Specified by:
getGroupID in interface QueryMetadataInterface
Overrides:
getGroupID in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getGroupsForPartialName

public java.util.Collection getGroupsForPartialName(java.lang.String partialGroupName)
                                             throws MetaMatrixComponentException,
                                                    QueryMetadataException
Specified by:
getGroupsForPartialName in interface QueryMetadataInterface
Overrides:
getGroupsForPartialName in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getModelID

public java.lang.Object getModelID(java.lang.Object groupOrElementID)
                            throws MetaMatrixComponentException,
                                   QueryMetadataException
Specified by:
getModelID in interface QueryMetadataInterface
Overrides:
getModelID in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getFullName

public java.lang.String getFullName(java.lang.Object metadataID)
                             throws MetaMatrixComponentException,
                                    QueryMetadataException
Specified by:
getFullName in interface QueryMetadataInterface
Overrides:
getFullName in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getFullElementName

public java.lang.String getFullElementName(java.lang.String fullGroupName,
                                           java.lang.String shortElementName)
                                    throws MetaMatrixComponentException,
                                           QueryMetadataException
Specified by:
getFullElementName in interface QueryMetadataInterface
Overrides:
getFullElementName in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getShortElementName

public java.lang.String getShortElementName(java.lang.String fullElementName)
                                     throws MetaMatrixComponentException,
                                            QueryMetadataException
Specified by:
getShortElementName in interface QueryMetadataInterface
Overrides:
getShortElementName in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getGroupName

public java.lang.String getGroupName(java.lang.String fullElementName)
                              throws MetaMatrixComponentException,
                                     QueryMetadataException
Return the text portion of the fullElementName representing a group. That means that this should only return text that is part of the fullElementName and not look up new IDs or do much of anything fancy. This method is used by the resolver to decide which portion of a fully- qualified element name is the group name. It will compare whatever comes back with the actual group names and aliases in the query, which is why it is important not to introduce new metadata here. Also, returning null indicates that no portion of the fullElementName is a group name - that is ok as it will be resolved as an ambiguous element.

Specified by:
getGroupName in interface QueryMetadataInterface
Overrides:
getGroupName in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
See Also:
QueryMetadataInterface.getGroupName(java.lang.String)

getElementIDsInGroupID

public java.util.List getElementIDsInGroupID(java.lang.Object groupID)
                                      throws MetaMatrixComponentException,
                                             QueryMetadataException
Specified by:
getElementIDsInGroupID in interface QueryMetadataInterface
Overrides:
getElementIDsInGroupID in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getGroupIDForElementID

public java.lang.Object getGroupIDForElementID(java.lang.Object elementID)
                                        throws MetaMatrixComponentException,
                                               QueryMetadataException
Specified by:
getGroupIDForElementID in interface QueryMetadataInterface
Overrides:
getGroupIDForElementID in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getStoredProcedureInfoForProcedure

public StoredProcedureInfo getStoredProcedureInfoForProcedure(java.lang.String fullyQualifiedProcedureName)
                                                       throws MetaMatrixComponentException,
                                                              QueryMetadataException
Specified by:
getStoredProcedureInfoForProcedure in interface QueryMetadataInterface
Overrides:
getStoredProcedureInfoForProcedure in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getElementType

public java.lang.String getElementType(java.lang.Object elementID)
                                throws MetaMatrixComponentException,
                                       QueryMetadataException
Specified by:
getElementType in interface QueryMetadataInterface
Overrides:
getElementType in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getDefaultValue

public java.lang.Object getDefaultValue(java.lang.Object elementID)
                                 throws MetaMatrixComponentException,
                                        QueryMetadataException
Specified by:
getDefaultValue in interface QueryMetadataInterface
Overrides:
getDefaultValue in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getMinimumValue

public java.lang.Object getMinimumValue(java.lang.Object elementID)
                                 throws MetaMatrixComponentException,
                                        QueryMetadataException
Specified by:
getMinimumValue in interface QueryMetadataInterface
Overrides:
getMinimumValue in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getMaximumValue

public java.lang.Object getMaximumValue(java.lang.Object elementID)
                                 throws MetaMatrixComponentException,
                                        QueryMetadataException
Specified by:
getMaximumValue in interface QueryMetadataInterface
Overrides:
getMaximumValue in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

isVirtualGroup

public boolean isVirtualGroup(java.lang.Object groupID)
                       throws MetaMatrixComponentException,
                              QueryMetadataException
Specified by:
isVirtualGroup in interface QueryMetadataInterface
Overrides:
isVirtualGroup in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

isProcedure

public boolean isProcedure(java.lang.Object groupID)
                    throws MetaMatrixComponentException,
                           QueryMetadataException
Specified by:
isProcedure in interface QueryMetadataInterface
Overrides:
isProcedure in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
4.2
See Also:
com.metamatrix.query.metadata.QueryMetadataInterface#isProcedureInputElement(java.lang.Object)

isVirtualModel

public boolean isVirtualModel(java.lang.Object modelID)
                       throws MetaMatrixComponentException,
                              QueryMetadataException
Specified by:
isVirtualModel in interface QueryMetadataInterface
Overrides:
isVirtualModel in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getVirtualPlan

public QueryNode getVirtualPlan(java.lang.Object groupID)
                         throws MetaMatrixComponentException,
                                QueryMetadataException
Specified by:
getVirtualPlan in interface QueryMetadataInterface
Overrides:
getVirtualPlan in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getInsertPlan

public java.lang.String getInsertPlan(java.lang.Object groupID)
                               throws MetaMatrixComponentException,
                                      QueryMetadataException
Specified by:
getInsertPlan in interface QueryMetadataInterface
Overrides:
getInsertPlan in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getUpdatePlan

public java.lang.String getUpdatePlan(java.lang.Object groupID)
                               throws MetaMatrixComponentException,
                                      QueryMetadataException
Specified by:
getUpdatePlan in interface QueryMetadataInterface
Overrides:
getUpdatePlan in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getDeletePlan

public java.lang.String getDeletePlan(java.lang.Object groupID)
                               throws MetaMatrixComponentException,
                                      QueryMetadataException
Specified by:
getDeletePlan in interface QueryMetadataInterface
Overrides:
getDeletePlan in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

modelSupports

public boolean modelSupports(java.lang.Object modelID,
                             int modelConstant)
                      throws MetaMatrixComponentException,
                             QueryMetadataException
Specified by:
modelSupports in interface QueryMetadataInterface
Overrides:
modelSupports in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

groupSupports

public boolean groupSupports(java.lang.Object groupID,
                             int groupConstant)
                      throws MetaMatrixComponentException,
                             QueryMetadataException
Specified by:
groupSupports in interface QueryMetadataInterface
Overrides:
groupSupports in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

elementSupports

public boolean elementSupports(java.lang.Object elementID,
                               int elementConstant)
                        throws MetaMatrixComponentException,
                               QueryMetadataException
Specified by:
elementSupports in interface QueryMetadataInterface
Overrides:
elementSupports in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getMaxSetSize

public int getMaxSetSize(java.lang.Object modelID)
                  throws MetaMatrixComponentException,
                         QueryMetadataException
Specified by:
getMaxSetSize in interface QueryMetadataInterface
Overrides:
getMaxSetSize in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getIndexesInGroup

public java.util.Collection getIndexesInGroup(java.lang.Object groupID)
                                       throws MetaMatrixComponentException,
                                              QueryMetadataException
Specified by:
getIndexesInGroup in interface QueryMetadataInterface
Overrides:
getIndexesInGroup in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getUniqueKeysInGroup

public java.util.Collection getUniqueKeysInGroup(java.lang.Object groupID)
                                          throws MetaMatrixComponentException,
                                                 QueryMetadataException
Specified by:
getUniqueKeysInGroup in interface QueryMetadataInterface
Overrides:
getUniqueKeysInGroup in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getForeignKeysInGroup

public java.util.Collection getForeignKeysInGroup(java.lang.Object groupID)
                                           throws MetaMatrixComponentException,
                                                  QueryMetadataException
Specified by:
getForeignKeysInGroup in interface QueryMetadataInterface
Overrides:
getForeignKeysInGroup in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getPrimaryKeyIDForForeignKeyID

public java.lang.Object getPrimaryKeyIDForForeignKeyID(java.lang.Object foreignKeyID)
                                                throws MetaMatrixComponentException,
                                                       QueryMetadataException
Specified by:
getPrimaryKeyIDForForeignKeyID in interface QueryMetadataInterface
Overrides:
getPrimaryKeyIDForForeignKeyID in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getAccessPatternsInGroup

public java.util.Collection getAccessPatternsInGroup(java.lang.Object groupID)
                                              throws MetaMatrixComponentException,
                                                     QueryMetadataException
Specified by:
getAccessPatternsInGroup in interface QueryMetadataInterface
Overrides:
getAccessPatternsInGroup in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getElementIDsInIndex

public java.util.List getElementIDsInIndex(java.lang.Object index)
                                    throws MetaMatrixComponentException,
                                           QueryMetadataException
Specified by:
getElementIDsInIndex in interface QueryMetadataInterface
Overrides:
getElementIDsInIndex in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getElementIDsInKey

public java.util.List getElementIDsInKey(java.lang.Object key)
                                  throws MetaMatrixComponentException,
                                         QueryMetadataException
Specified by:
getElementIDsInKey in interface QueryMetadataInterface
Overrides:
getElementIDsInKey in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getElementIDsInAccessPattern

public java.util.List getElementIDsInAccessPattern(java.lang.Object accessPattern)
                                            throws MetaMatrixComponentException,
                                                   QueryMetadataException
Specified by:
getElementIDsInAccessPattern in interface QueryMetadataInterface
Overrides:
getElementIDsInAccessPattern in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

isXMLGroup

public boolean isXMLGroup(java.lang.Object groupID)
                   throws MetaMatrixComponentException,
                          QueryMetadataException
Specified by:
isXMLGroup in interface QueryMetadataInterface
Overrides:
isXMLGroup in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

isTemporaryGroup

public boolean isTemporaryGroup(java.lang.Object groupID)
                         throws MetaMatrixComponentException,
                                QueryMetadataException
Throws:
MetaMatrixComponentException
QueryMetadataException

hasMaterialization

public boolean hasMaterialization(java.lang.Object groupID)
                           throws MetaMatrixComponentException,
                                  QueryMetadataException
Specified by:
hasMaterialization in interface QueryMetadataInterface
Overrides:
hasMaterialization in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
4.2
See Also:
QueryMetadataInterface.hasMaterialization(java.lang.Object)

getMaterialization

public java.lang.Object getMaterialization(java.lang.Object groupID)
                                    throws MetaMatrixComponentException,
                                           QueryMetadataException
Specified by:
getMaterialization in interface QueryMetadataInterface
Overrides:
getMaterialization in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
4.2
See Also:
QueryMetadataInterface.getMaterialization(java.lang.Object)

getMaterializationStage

public java.lang.Object getMaterializationStage(java.lang.Object groupID)
                                         throws MetaMatrixComponentException,
                                                QueryMetadataException
Specified by:
getMaterializationStage in interface QueryMetadataInterface
Overrides:
getMaterializationStage in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
4.2
See Also:
QueryMetadataInterface.getMaterializationStage(java.lang.Object)

getMappingNode

public MappingNode getMappingNode(java.lang.Object groupID)
                           throws MetaMatrixComponentException,
                                  QueryMetadataException
Specified by:
getMappingNode in interface QueryMetadataInterface
Overrides:
getMappingNode in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getVirtualDatabaseName

public java.lang.String getVirtualDatabaseName()
                                        throws MetaMatrixComponentException,
                                               QueryMetadataException
Specified by:
getVirtualDatabaseName in interface QueryMetadataInterface
Overrides:
getVirtualDatabaseName in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getXMLTempGroups

public java.util.Collection getXMLTempGroups(java.lang.Object groupID)
                                      throws MetaMatrixComponentException,
                                             QueryMetadataException
Specified by:
getXMLTempGroups in interface QueryMetadataInterface
Overrides:
getXMLTempGroups in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getCardinality

public int getCardinality(java.lang.Object groupID)
                   throws MetaMatrixComponentException,
                          QueryMetadataException
Specified by:
getCardinality in interface QueryMetadataInterface
Overrides:
getCardinality in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getXMLSchemas

public java.util.List getXMLSchemas(java.lang.Object groupID)
                             throws MetaMatrixComponentException,
                                    QueryMetadataException
Specified by:
getXMLSchemas in interface QueryMetadataInterface
Overrides:
getXMLSchemas in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getNameInSource

public java.lang.String getNameInSource(java.lang.Object metadataID)
                                 throws MetaMatrixComponentException,
                                        QueryMetadataException
Specified by:
getNameInSource in interface QueryMetadataInterface
Overrides:
getNameInSource in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getElementLength

public int getElementLength(java.lang.Object elementID)
                     throws MetaMatrixComponentException,
                            QueryMetadataException
Specified by:
getElementLength in interface QueryMetadataInterface
Overrides:
getElementLength in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getPosition

public int getPosition(java.lang.Object elementID)
                throws MetaMatrixComponentException,
                       QueryMetadataException
Specified by:
getPosition in interface QueryMetadataInterface
Overrides:
getPosition in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getPrecision

public int getPrecision(java.lang.Object elementID)
                 throws MetaMatrixComponentException,
                        QueryMetadataException
Specified by:
getPrecision in interface QueryMetadataInterface
Overrides:
getPrecision in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getRadix

public int getRadix(java.lang.Object elementID)
             throws MetaMatrixComponentException,
                    QueryMetadataException
Specified by:
getRadix in interface QueryMetadataInterface
Overrides:
getRadix in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getFormat

public java.lang.String getFormat(java.lang.Object elementID)
                           throws MetaMatrixComponentException,
                                  QueryMetadataException
Specified by:
getFormat in interface QueryMetadataInterface
Overrides:
getFormat in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getScale

public int getScale(java.lang.Object elementID)
             throws MetaMatrixComponentException,
                    QueryMetadataException
Specified by:
getScale in interface QueryMetadataInterface
Overrides:
getScale in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getDistinctValues

public int getDistinctValues(java.lang.Object elementID)
                      throws MetaMatrixComponentException,
                             QueryMetadataException
Specified by:
getDistinctValues in interface QueryMetadataInterface
Overrides:
getDistinctValues in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getNullValues

public int getNullValues(java.lang.Object elementID)
                  throws MetaMatrixComponentException,
                         QueryMetadataException
Specified by:
getNullValues in interface QueryMetadataInterface
Overrides:
getNullValues in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getNativeType

public java.lang.String getNativeType(java.lang.Object elementID)
                               throws MetaMatrixComponentException,
                                      QueryMetadataException
Specified by:
getNativeType in interface QueryMetadataInterface
Overrides:
getNativeType in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getExtensionProperties

public java.util.Properties getExtensionProperties(java.lang.Object metadataID)
                                            throws MetaMatrixComponentException,
                                                   QueryMetadataException
Specified by:
getExtensionProperties in interface QueryMetadataInterface
Overrides:
getExtensionProperties in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException

getBinaryVDBResource

public byte[] getBinaryVDBResource(java.lang.String resourcePath)
                            throws MetaMatrixComponentException,
                                   QueryMetadataException
Specified by:
getBinaryVDBResource in interface QueryMetadataInterface
Overrides:
getBinaryVDBResource in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
4.3
See Also:
BasicQueryMetadata.getBinaryVDBResource(java.lang.String)

getCharacterVDBResource

public java.lang.String getCharacterVDBResource(java.lang.String resourcePath)
                                         throws MetaMatrixComponentException,
                                                QueryMetadataException
Specified by:
getCharacterVDBResource in interface QueryMetadataInterface
Overrides:
getCharacterVDBResource in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
4.3
See Also:
BasicQueryMetadata.getCharacterVDBResource(java.lang.String)

getVDBResourcePaths

public java.lang.String[] getVDBResourcePaths()
                                       throws MetaMatrixComponentException,
                                              QueryMetadataException
Specified by:
getVDBResourcePaths in interface QueryMetadataInterface
Overrides:
getVDBResourcePaths in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
4.3
See Also:
BasicQueryMetadata.getVDBResourcePaths()

getModeledType

public java.lang.String getModeledType(java.lang.Object elementID)
                                throws MetaMatrixComponentException,
                                       QueryMetadataException
Specified by:
getModeledType in interface QueryMetadataInterface
Overrides:
getModeledType in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
5.0
See Also:
QueryMetadataInterface.getModeledType(java.lang.Object)

getModeledBaseType

public java.lang.String getModeledBaseType(java.lang.Object elementID)
                                    throws MetaMatrixComponentException,
                                           QueryMetadataException
Specified by:
getModeledBaseType in interface QueryMetadataInterface
Overrides:
getModeledBaseType in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
5.0
See Also:
QueryMetadataInterface.getModeledBaseType(java.lang.Object)

getModeledPrimitiveType

public java.lang.String getModeledPrimitiveType(java.lang.Object elementID)
                                         throws MetaMatrixComponentException,
                                                QueryMetadataException
Specified by:
getModeledPrimitiveType in interface QueryMetadataInterface
Overrides:
getModeledPrimitiveType in class BasicQueryMetadata
Throws:
MetaMatrixComponentException
QueryMetadataException
Since:
5.0
See Also:
QueryMetadataInterface.getModeledPrimitiveType(java.lang.Object)

getDatatypeRecord

protected DatatypeRecord getDatatypeRecord(java.lang.Object elementID)
                                    throws MetaMatrixComponentException,
                                           QueryMetadataException
Throws:
MetaMatrixComponentException
QueryMetadataException

getIndexes

protected com.metamatrix.internal.core.index.Index[] getIndexes(char recordType,
                                                                IndexSelector selector)
                                                         throws MetaMatrixComponentException
Return the array of MtkIndex instances representing temporary indexes

Parameters:
selector -
Returns:
Throws:
QueryMetadataException
MetaMatrixComponentException

getDatatypeUUIDMatchPattern

protected java.lang.String getDatatypeUUIDMatchPattern(java.lang.String uuid)
Return the pattern match string that could be used to match a UUID in a datatype index record. The RECORD_TYPE.DATATYPE records contain a header portion of the form: recordType|datatypeID|basetypeID|fullName|objectID|nameInSource|...

Parameters:
uuid - The UUID for which the pattern match string is to be constructed.
Returns:
The pattern match string of the form: recordType|*|*|*|uuid|*

getUUIDMatchPattern

protected java.lang.String getUUIDMatchPattern(char recordType,
                                               java.lang.String uuid)
Return the pattern match string that could be used to match a UUID in an index record. All index records contain a header portion of the form: recordType|pathInModel|UUID|nameInSource|parentObjectID|

Parameters:
uuid - The UUID for which the pattern match string is to be constructed.
Returns:
The pattern match string of the form: recordType|*|uuid|*

getMatchPattern

protected java.lang.String getMatchPattern(char recordType,
                                           java.lang.String name)
Return the pattern match string that could be used to match a partially/fully qualified entity name in an index record. All index records contain a header portion of the form: recordType|pathInModel|UUID|nameInSource|parentObjectID|

Parameters:
name - The partially/fully qualified name for which the pattern match string is to be constructed.
Returns:
The pattern match string of the form: recordType|*name|*

getPrefixPattern

protected java.lang.String getPrefixPattern(char recordType,
                                            java.lang.String name)
Return the prefix match string that could be used to exactly match a fully qualified entity name in an index record. All index records contain a header portion of the form: recordType|pathInModel|UUID|nameInSource|parentObjectID|

Parameters:
name - The fully qualified name for which the prefix match string is to be constructed.
Returns:
The pattern match string of the form: recordType|name|

getUUIDPrefixPattern

protected java.lang.String getUUIDPrefixPattern(char recordType,
                                                java.lang.String uuid)
Return the prefix match string that could be used to exactly match a uuid in an index record.

Parameters:
uuid - The uuid for which the prefix match string is to be constructed.
Returns:
The pattern match string of the form: recordType|uuid|

getParentPrefixPattern

protected java.lang.String getParentPrefixPattern(char recordType,
                                                  java.lang.String name)
Return the prefix match string that could be used to exactly match a fully qualified entity name in an index record. All index records contain a header portion of the form: recordType|pathInModel|UUID|nameInSource|parentObjectID|

Parameters:
name - The fully qualified name for which the prefix match string is to be constructed.
Returns:
The pattern match string of the form: recordType|name|

getRecordByType

protected MetadataRecord getRecordByType(java.lang.String entityName,
                                         char recordType)
                                  throws MetaMatrixComponentException,
                                         QueryMetadataException
Get a MetadataRecord object given a entityName/UUID.

Parameters:
entityName - String representing an entity, may be null(vdbs)
recordType - The record type for the entity
Returns:
A MetadataRecord object for a given entityName/UUID
Throws:
MetaMatrixComponentException
QueryMetadataException

filterMetadataRecordForUUID

protected void filterMetadataRecordForUUID(java.lang.String uuid,
                                           java.util.Collection records)
Remove any MetadataRecord instances that do not match the specified uuid Due to the pattern matching used to query index files if an index record matched the specified uuid string anywhere in that record it would be returned in the results (for example, if the parent ObjectID in the index record matched the specified uuid).

Parameters:
uuid -
records -
Since:
4.2

getIndexSelector

protected IndexSelector getIndexSelector()
Return the IndexSelector reference

Returns:

getContext

protected QueryMetadataContext getContext()
Return the QueryMetadataContext reference

Returns:

findChildRecords

protected java.util.Collection findChildRecords(MetadataRecord parentRecord,
                                                char childRecordType)
                                         throws MetaMatrixComponentException
Return all index file records that match the specified entity name, filtering by matching on parent uuid

Parameters:
parentRecord -
childRecordType - the type of the child to seek uuids
uuids - to filter just the objects we want
Returns:
columnRecords
Throws:
MetaMatrixComponentException

findChildRecordsForColumns

protected java.util.Collection findChildRecordsForColumns(MetadataRecord parentRecord,
                                                          char childRecordType,
                                                          java.util.List uuids)
                                                   throws MetaMatrixComponentException
Return all index file records that match the specified entity name, filtering by matching on the child uuids

Parameters:
parentRecord -
childRecordType - the type of the child to seek uuids
uuids - to filter just the objects we want
Returns:
columnRecords
Throws:
MetaMatrixComponentException

findChildRecordsWithoutFiltering

protected java.util.Collection findChildRecordsWithoutFiltering(MetadataRecord parentRecord,
                                                                char childRecordType)
                                                         throws MetaMatrixComponentException
Return all index file records that match the specified entity name, without filtering

Parameters:
parentRecord -
childRecordType - the type of the child to seek
Returns:
records
Throws:
MetaMatrixComponentException

findMetadataRecords

protected java.util.Collection findMetadataRecords(IEntryResult[] results)
Return all index file records that match the specified entity name

Parameters:
indexName -
entityName - the name to match
isPartialName - true if the entity name is a partially qualified
Returns:
results
Throws:
QueryMetadataException

findMetadataRecord

protected MetadataRecord findMetadataRecord(IEntryResult result)

findMetadataRecords

protected java.util.Collection findMetadataRecords(char recordType,
                                                   java.lang.String entityName,
                                                   boolean isPartialName)
                                            throws MetaMatrixComponentException
Return all index file records that match the specified entity name

Parameters:
indexName -
entityName - the name to match
isPartialName - true if the entity name is a partially qualified
Returns:
results
Throws:
QueryMetadataException
MetaMatrixComponentException

queryIndex

protected IEntryResult[] queryIndex(char recordType,
                                    java.lang.String entityName,
                                    boolean isPartialName)
                             throws MetaMatrixComponentException
Return all index file records that match the specified entity name

Parameters:
indexName -
entityName - the name to match
isPartialName - true if the entity name is a partially qualified
Returns:
results
Throws:
QueryMetadataException
MetaMatrixComponentException

queryIndex

protected IEntryResult[] queryIndex(com.metamatrix.internal.core.index.Index[] indexes,
                                    char[] pattern,
                                    boolean isPrefix,
                                    boolean returnFirstMatch)
                             throws MetaMatrixComponentException
Return all index file records that match the specified record pattern.

Parameters:
indexes - the array of MtkIndex instances to query
pattern -
Returns:
results
Throws:
QueryMetadataException
MetaMatrixComponentException

queryIndex

protected IEntryResult[] queryIndex(com.metamatrix.internal.core.index.Index[] indexes,
                                    char[] pattern,
                                    boolean isPrefix,
                                    boolean isCaseSensitive,
                                    boolean returnFirstMatch)
                             throws MetaMatrixComponentException
Return all index file records that match the specified record pattern.

Parameters:
indexes - the array of MtkIndex instances to query
pattern -
Returns:
results
Throws:
QueryMetadataException
MetaMatrixComponentException


Copyright © 2009. All Rights Reserved.