Package org.teiid.query.metadata
Class BasicQueryMetadata
- java.lang.Object
-
- org.teiid.query.metadata.BasicQueryMetadata
-
- All Implemented Interfaces:
QueryMetadataInterface
- Direct Known Subclasses:
TransformationMetadata
public class BasicQueryMetadata extends Object implements QueryMetadataInterface
This is an abstract implementation of the metadata interface. It can be subclassed to create test implementations or partial implementations.
-
-
Field Summary
-
Fields inherited from interface org.teiid.query.metadata.QueryMetadataInterface
UNKNOWN_CARDINALITY
-
-
Constructor Summary
Constructors Constructor Description BasicQueryMetadata()
Constructor for AbstractQueryMetadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
addToMetadataCache(Object metadataID, String key, Object value)
boolean
elementSupports(Object elementID, int elementConstant)
Determine whether the specified element supports some feature.boolean
findShortName()
Collection
getAccessPatternsInGroup(Object groupID)
Get the access patterns for the specified groupbyte[]
getBinaryVDBResource(String resourcePath)
Gets the contents of a VDB resource in binary form.float
getCardinality(Object groupID)
Return the cardinality for this groupString
getCharacterVDBResource(String resourcePath)
Gets the contents of a VDB resource as a String.Class<?>
getDataTypeClass(String typeName)
Get the runtime type class for the given type name, which may include domainsString
getDefaultValue(Object elementID)
Get the element's default value for an element symbolString
getDeletePlan(Object groupID)
Get procedure defining the delete plan for this group.QueryMetadataInterface
getDesignTimeMetadata()
Get the metadata without visibility and session tablesfloat
getDistinctValues(Object elementID)
Get the number of distinct values for this column.Object
getElementID(String elementName)
Get the metadata-implementation identifier object for the given element name.List
getElementIDsInAccessPattern(Object accessPattern)
Get the elements in the access patternList
getElementIDsInGroupID(Object groupID)
Get list of metadata element IDs for a group IDList
getElementIDsInKey(Object key)
Get the elements in the keyint
getElementLength(Object elementID)
Get the element length for a given element ID.String
getElementRuntimeTypeName(Object elementID)
Get the element type name for an element symbol.Properties
getExtensionProperties(Object metadataID)
Get all extension properties defined on this metadata objectString
getExtensionProperty(Object metadataID, String key, boolean checkUnqualified)
Collection
getForeignKeysInGroup(Object groupID)
Get the foreign keys for the specified groupString
getFormat(Object elementID)
Get the element's formatObject
getFromMetadataCache(Object metadataID, String key)
String
getFullName(Object metadataID)
Get the fully qualified (unique) name of the metadata identifier specified.Map<Expression,Integer>
getFunctionBasedExpressions(Object metadataID)
FunctionLibrary
getFunctionLibrary()
Object
getGroupID(String groupName)
Get the metadata-implementation identifier object for the given group name.Object
getGroupIDForElementID(Object elementID)
Get containg group ID given element IDCollection
getGroupsForPartialName(String partialGroupName)
Get a collection of group names that match the partially qualified group name.Set<String>
getImportedModels()
Collection
getIndexesInGroup(Object groupID)
Get the indexes for the specified groupString
getInsertPlan(Object groupID)
Get procedure defining the insert plan for this group.Object
getMaterialization(Object groupID)
Accquire the physical group ID (the Materialization) for the given virtual group ID, ornull
if the given virtual group has no Materialization.Object
getMaterializationStage(Object groupID)
Accquire the physical group ID that is used for the staging area for loading (the Materialization) for the given virtual group ID, ornull
if the given virtual group has no Materialization.Object
getMaximumValue(Object elementID)
Get the element's default value for an element symbolint
getMaxSetSize(Object modelID)
Get the max set size for the specified model.Object
getMinimumValue(Object elementID)
Get the element's minimum value for an element symbolObject
getModelID(Object groupOrElementID)
Get the metadata-implementation identifier object for the model containing the specified group or element ID.Object
getModelID(String modelName)
List<? extends Object>
getModelIDs()
String
getName(Object metadataID)
Get the name of the metadata identifier specified.String
getNameInSource(Object metadataID)
Get the name in source of the metadata identifier specified.String
getNativeType(Object elementID)
Get the native type of the element specified.float
getNullValues(Object elementID)
Get the number of distinct values for this column.int
getPosition(Object elementID)
Get the element's position in the groupint
getPrecision(Object elementID)
Get the element's precisionObject
getPrimaryKey(Object metadataID)
Object
getPrimaryKeyIDForForeignKeyID(Object foreignKeyID)
Get the corresponding primary key ID for the specified foreign key IDFunctionMethod
getPushdownFunction(Object modelID, String fullName)
int
getRadix(Object elementID)
Get the element's radixint
getScale(Object elementID)
Get the element's scaleScriptEngine
getScriptEngine(String language)
ScriptEngine
getScriptEngineDirect(String language)
QueryMetadataInterface
getSessionMetadata()
StoredProcedureInfo
getStoredProcedureInfoForProcedure(String fullyQualifiedProcedureName)
Get the the StoredProcedureInfo based on the fully qualified procedure nameCollection
getUniqueKeysInGroup(Object groupID)
Get the unique keys for the specified group (primary and unique keys) The primary key if present will be first in the collectionString
getUpdatePlan(Object groupID)
Get procedure defining the update plan for this group.String[]
getVDBResourcePaths()
Gets the resource paths of all the resources in the VDB.String
getVirtualDatabaseName()
Get the currently connected virtual database name.QueryNode
getVirtualPlan(Object groupID)
Get virtual plan for a group symbol.List
getXMLSchemas(Object groupID)
boolean
groupSupports(Object groupID, int groupConstant)
Determine whether the specified group supports some feature.boolean
hasMaterialization(Object groupID)
Determine whether given virtual group has an associated Materialization.boolean
hasProcedure(String name)
Return true if a procedure exists with the given name (partial or fqn)boolean
isEnvAllowed()
boolean
isLongRanks()
boolean
isMultiSource(Object modelId)
boolean
isMultiSourceElement(Object elementId)
boolean
isProcedure(Object elementID)
Determine whether this is a procedureboolean
isPseudo(Object elementId)
boolean
isScalarGroup(Object groupID)
boolean
isTemporaryTable(Object groupID)
Determine whether a group is a temporary table.boolean
isVariadic(Object metadataID)
boolean
isVirtualGroup(Object groupID)
Determine whether a group is virtual or not.boolean
isVirtualModel(Object modelID)
Determine whether a model is virtual or not.boolean
modelSupports(Object modelID, int modelConstant)
Determine whether the specified model supports some feature.boolean
useOutputName()
boolean
widenComparisonToString()
-
-
-
Method Detail
-
getElementID
public Object getElementID(String elementName) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the metadata-implementation identifier object for the given element name.- Specified by:
getElementID
in interfaceQueryMetadataInterface
- Parameters:
elementName
- Fully qualified element name- Returns:
- Metadata identifier for this element
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getElementID(String)
-
getGroupID
public Object getGroupID(String groupName) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the metadata-implementation identifier object for the given group name.- Specified by:
getGroupID
in interfaceQueryMetadataInterface
- Parameters:
groupName
- Fully qualified group name- Returns:
- Metadata identifier for this group
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getGroupID(String)
-
getGroupsForPartialName
public Collection getGroupsForPartialName(String partialGroupName) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get a collection of group names that match the partially qualified group name.- Specified by:
getGroupsForPartialName
in interfaceQueryMetadataInterface
- Parameters:
partialGroupName
- Partially qualified group name- Returns:
- A collection of groups whose names are matched by the partial name.
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getGroupID(String)
-
getModelID
public Object getModelID(Object groupOrElementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the metadata-implementation identifier object for the model containing the specified group or element ID.- Specified by:
getModelID
in interfaceQueryMetadataInterface
- Parameters:
groupOrElementID
- Metadata group or element ID- Returns:
- Metadata identifier for the model
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getModelID(Object)
-
getFullName
public String getFullName(Object metadataID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the fully qualified (unique) name of the metadata identifier specified. This metadata identifier was previously returned by some other method.- Specified by:
getFullName
in interfaceQueryMetadataInterface
- Parameters:
metadataID
- Metadata identifier- Returns:
- Metadata identifier for this model
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getFullName(Object)
-
getElementIDsInGroupID
public List getElementIDsInGroupID(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get list of metadata element IDs for a group ID- Specified by:
getElementIDsInGroupID
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Group ID- Returns:
- List of Object, where each object is a metadata elementID for element within group
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getElementIDsInGroupID(Object)
-
getGroupIDForElementID
public Object getGroupIDForElementID(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get containg group ID given element ID- Specified by:
getGroupIDForElementID
in interfaceQueryMetadataInterface
- Parameters:
elementID
- Element ID- Returns:
- Group ID containing elementID
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getGroupIDForElementID(Object)
-
getStoredProcedureInfoForProcedure
public StoredProcedureInfo getStoredProcedureInfoForProcedure(String fullyQualifiedProcedureName) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the the StoredProcedureInfo based on the fully qualified procedure name- Specified by:
getStoredProcedureInfoForProcedure
in interfaceQueryMetadataInterface
- Parameters:
fullyQualifiedProcedureName
- the fully qualified stored procedure name- Returns:
- StoredProcedureInfo containing the runtime model id
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getStoredProcedureInfoForProcedure(String)
-
getElementRuntimeTypeName
public String getElementRuntimeTypeName(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element type name for an element symbol. These types are defined inDataTypeManager.DefaultDataTypes
.- Specified by:
getElementRuntimeTypeName
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element symbol- Returns:
- The element data type
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getDefaultValue
public String getDefaultValue(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element's default value for an element symbol- Specified by:
getDefaultValue
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The default value of the element
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getMaximumValue
public Object getMaximumValue(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element's default value for an element symbol- Specified by:
getMaximumValue
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The maximum value of the element
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getMinimumValue
public Object getMinimumValue(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element's minimum value for an element symbol- Specified by:
getMinimumValue
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The minimum value of the element
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getDistinctValues
public float getDistinctValues(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the number of distinct values for this column. Negative values (typically -1) indicate that the NDV is unknown. Only applicable for physical columns.- Specified by:
getDistinctValues
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The number of distinct values of this element in the data source
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- Since:
- 4.3
- See Also:
QueryMetadataInterface.getDistinctValues(java.lang.Object)
-
getNullValues
public float getNullValues(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the number of distinct values for this column. Negative values (typically -1) indicate that the NDV is unknown. Only applicable for physical columns.- Specified by:
getNullValues
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The number of distinct values of this element in the data source
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- Since:
- 4.3
- See Also:
QueryMetadataInterface.getNullValues(java.lang.Object)
-
getPosition
public int getPosition(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element's position in the group- Specified by:
getPosition
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The position of the element
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getPrecision
public int getPrecision(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element's precision- Specified by:
getPrecision
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The precision of the element
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getRadix
public int getRadix(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element's radix- Specified by:
getRadix
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The radix of the element
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getFormat
public String getFormat(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element's format- Specified by:
getFormat
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The format of the element
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getScale
public int getScale(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element's scale- Specified by:
getScale
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The scale of the element
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
isVirtualGroup
public boolean isVirtualGroup(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Determine whether a group is virtual or not.- Specified by:
isVirtualGroup
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Group symbol- Returns:
- True if virtual
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.isVirtualGroup(Object)
-
hasMaterialization
public boolean hasMaterialization(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Determine whether given virtual group has an associated Materialization. A Materialization is a cached version of the representation of a virtual group.- Specified by:
hasMaterialization
in interfaceQueryMetadataInterface
- Parameters:
groupID
- the groupID of the virtual group in question.- Returns:
- True if given virtual group has been marked as having a Materialization.
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- Since:
- 4.2
- See Also:
QueryMetadataInterface.hasMaterialization(java.lang.Object)
-
getMaterialization
public Object getMaterialization(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Accquire the physical group ID (the Materialization) for the given virtual group ID, ornull
if the given virtual group has no Materialization.- Specified by:
getMaterialization
in interfaceQueryMetadataInterface
- Parameters:
groupID
- the groupID of a virtual group that has a Materialization.- Returns:
- The groupID of the physical group that is a Materialization of the given virtual group.
- Throws:
TeiidComponentException
- Unexpected internal system problem during requestQueryMetadataException
- Metadata implementation detected a problem during the request- Since:
- 4.2
- See Also:
QueryMetadataInterface.getMaterialization(java.lang.Object)
-
getMaterializationStage
public Object getMaterializationStage(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Accquire the physical group ID that is used for the staging area for loading (the Materialization) for the given virtual group ID, ornull
if the given virtual group has no Materialization.- Specified by:
getMaterializationStage
in interfaceQueryMetadataInterface
- Parameters:
groupID
- the groupID of a virtual group that has a Materialization.- Returns:
- The groupID of the physical group that is the staging table for loading the Materialization of the given virtual group.
- Throws:
TeiidComponentException
- Unexpected internal system problem during requestQueryMetadataException
- Metadata implementation detected a problem during the request- Since:
- 4.2
- See Also:
QueryMetadataInterface.getMaterializationStage(java.lang.Object)
-
isVirtualModel
public boolean isVirtualModel(Object modelID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Determine whether a model is virtual or not.- Specified by:
isVirtualModel
in interfaceQueryMetadataInterface
- Parameters:
modelID
- model symbol- Returns:
- True if virtual
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.isVirtualModel(Object)
-
getVirtualPlan
public QueryNode getVirtualPlan(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get virtual plan for a group symbol.- Specified by:
getVirtualPlan
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Group- Returns:
- Root of tree of QueryNode objects
- Throws:
TeiidComponentException
QueryMetadataException
-
getInsertPlan
public String getInsertPlan(Object groupID) throws TeiidComponentException, QueryMetadataException
Get procedure defining the insert plan for this group.- Specified by:
getInsertPlan
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Group- Returns:
- A string giving the procedure for inserts.
- Throws:
TeiidComponentException
QueryMetadataException
-
getUpdatePlan
public String getUpdatePlan(Object groupID) throws TeiidComponentException, QueryMetadataException
Get procedure defining the update plan for this group.- Specified by:
getUpdatePlan
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Group- Returns:
- A string giving the procedure for inserts.
- Throws:
TeiidComponentException
QueryMetadataException
-
getDeletePlan
public String getDeletePlan(Object groupID) throws TeiidComponentException, QueryMetadataException
Get procedure defining the delete plan for this group.- Specified by:
getDeletePlan
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Group- Returns:
- A string giving the procedure for inserts.
- Throws:
TeiidComponentException
QueryMetadataException
-
modelSupports
public boolean modelSupports(Object modelID, int modelConstant) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Determine whether the specified model supports some feature.- Specified by:
modelSupports
in interfaceQueryMetadataInterface
- Parameters:
modelID
- Metadata identifier specifying the modelmodelConstant
- Constant fromSupportConstants.Model
- Returns:
- True if model supports feature
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.modelSupports(Object, int)
-
groupSupports
public boolean groupSupports(Object groupID, int groupConstant) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Determine whether the specified group supports some feature.- Specified by:
groupSupports
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Group metadata IDgroupConstant
- Constant fromSupportConstants.Group
- Returns:
- True if group supports feature
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.groupSupports(Object, int)
-
elementSupports
public boolean elementSupports(Object elementID, int elementConstant) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Determine whether the specified element supports some feature.- Specified by:
elementSupports
in interfaceQueryMetadataInterface
- Parameters:
elementID
- Element metadata IDelementConstant
- Constant fromSupportConstants.Element
- Returns:
- True if element supports feature
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.elementSupports(Object, int)
-
getMaxSetSize
public int getMaxSetSize(Object modelID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the max set size for the specified model.- Specified by:
getMaxSetSize
in interfaceQueryMetadataInterface
- Parameters:
modelID
- Metadata identifier specifying model- Returns:
- Maximum set size
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getMaxSetSize(Object)
-
getIndexesInGroup
public Collection getIndexesInGroup(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the indexes for the specified group- Specified by:
getIndexesInGroup
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Metadata identifier specifying group- Returns:
- Collection of Object (never null), each object representing an index
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getIndexesInGroup(java.lang.Object)
-
getUniqueKeysInGroup
public Collection getUniqueKeysInGroup(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the unique keys for the specified group (primary and unique keys) The primary key if present will be first in the collection- Specified by:
getUniqueKeysInGroup
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Metadata identifier specifying group- Returns:
- Collection of Object (never null), each object representing a unique key
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getUniqueKeysInGroup(Object)
-
getForeignKeysInGroup
public Collection getForeignKeysInGroup(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the foreign keys for the specified group- Specified by:
getForeignKeysInGroup
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Metadata identifier specifying group- Returns:
- Collection of Object (never null), each object representing a key
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getForeignKeysInGroup(Object)
-
getPrimaryKeyIDForForeignKeyID
public Object getPrimaryKeyIDForForeignKeyID(Object foreignKeyID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the corresponding primary key ID for the specified foreign key ID- Specified by:
getPrimaryKeyIDForForeignKeyID
in interfaceQueryMetadataInterface
- Parameters:
foreignKeyID
- Metadata identifier of a foreign key- Returns:
- Metadata ID of the corresponding primary key
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getPrimaryKeyIDForForeignKeyID(Object)
-
getElementIDsInKey
public List getElementIDsInKey(Object key) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the elements in the key- Specified by:
getElementIDsInKey
in interfaceQueryMetadataInterface
- Parameters:
key
- Key identifier, as returned byQueryMetadataInterface.getUniqueKeysInGroup(java.lang.Object)
- Returns:
- List of Object, where each object is a metadata element identifier
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getElementIDsInKey(Object)
-
getAccessPatternsInGroup
public Collection getAccessPatternsInGroup(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the access patterns for the specified group- Specified by:
getAccessPatternsInGroup
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Metadata identifier specifying group- Returns:
- Collection of Object (never null), each object representing an access pattern
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getAccessPatternsInGroup(Object)
-
getElementIDsInAccessPattern
public List getElementIDsInAccessPattern(Object accessPattern) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the elements in the access pattern- Specified by:
getElementIDsInAccessPattern
in interfaceQueryMetadataInterface
- Parameters:
accessPattern
- access pattern identifier, as returned byQueryMetadataInterface.getAccessPatternsInGroup(java.lang.Object)
- Returns:
- List of Object, where each object is a metadata element identifier
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getElementIDsInAccessPattern(Object)
-
getVirtualDatabaseName
public String getVirtualDatabaseName() throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the currently connected virtual database name. If the current metadata is not virtual-database specific, then null should be returned.- Specified by:
getVirtualDatabaseName
in interfaceQueryMetadataInterface
- Returns:
- Name of current virtual database
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- See Also:
QueryMetadataInterface.getVirtualDatabaseName()
-
getCardinality
public float getCardinality(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Return the cardinality for this group- Specified by:
getCardinality
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Metadata identifier specifying group- Returns:
- cardinality for the given group. If unknown, return UNKNOWN_CARDINALITY.
- Throws:
TeiidComponentException
QueryMetadataException
-
getXMLSchemas
public List getXMLSchemas(Object groupID) throws TeiidComponentException, QueryMetadataException
-
getNameInSource
public String getNameInSource(Object metadataID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the name in source of the metadata identifier specified. This metadata identifier was previously returned by some other method.- Specified by:
getNameInSource
in interfaceQueryMetadataInterface
- Parameters:
metadataID
- Metadata identifier- Returns:
- Name in source as a string.
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getElementLength
public int getElementLength(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element length for a given element ID. These types are defined inDataTypeManager.DefaultDataTypes
.- Specified by:
getElementLength
in interfaceQueryMetadataInterface
- Parameters:
elementID
- The element ID- Returns:
- The element length
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getExtensionProperties
public Properties getExtensionProperties(Object metadataID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get all extension properties defined on this metadata object- Specified by:
getExtensionProperties
in interfaceQueryMetadataInterface
- Parameters:
metadataID
- Typically element, group, model, or procedure- Returns:
- All extension properties for this object or null for none
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getNativeType
public String getNativeType(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the native type of the element specified. This element identifier was previously returned by some other method.- Specified by:
getNativeType
in interfaceQueryMetadataInterface
- Parameters:
elementID
- Element identifier- Returns:
- Native type name
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
isProcedure
public boolean isProcedure(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Determine whether this is a procedure- Specified by:
isProcedure
in interfaceQueryMetadataInterface
- Parameters:
elementID
- Group identifier- Returns:
- True if it is an procedure; false otherwise
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getBinaryVDBResource
public byte[] getBinaryVDBResource(String resourcePath) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Gets the contents of a VDB resource in binary form.- Specified by:
getBinaryVDBResource
in interfaceQueryMetadataInterface
- Parameters:
resourcePath
- a path returned by getVDBResourcePaths()- Returns:
- the binary contents of the resource in a byte[]
- Throws:
TeiidComponentException
- Unexpected internal system problem during requestQueryMetadataException
- Metadata implementation detected a problem during the request
-
getCharacterVDBResource
public String getCharacterVDBResource(String resourcePath) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Gets the contents of a VDB resource as a String.- Specified by:
getCharacterVDBResource
in interfaceQueryMetadataInterface
- Parameters:
resourcePath
- a path returned by getVDBResourcePaths()- Returns:
- the contents of the resource as a String.
- Throws:
TeiidComponentException
- Unexpected internal system problem during requestQueryMetadataException
- Metadata implementation detected a problem during the request
-
getVDBResourcePaths
public String[] getVDBResourcePaths() throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Gets the resource paths of all the resources in the VDB.- Specified by:
getVDBResourcePaths
in interfaceQueryMetadataInterface
- Returns:
- an array of resource paths of the resources in the VDB
- Throws:
TeiidComponentException
- Unexpected internal system problem during requestQueryMetadataException
- Metadata implementation detected a problem during the request
-
isTemporaryTable
public boolean isTemporaryTable(Object groupID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Determine whether a group is a temporary table.- Specified by:
isTemporaryTable
in interfaceQueryMetadataInterface
- Parameters:
groupID
- Group to check- Returns:
- True if group is a temporary group
- Throws:
TeiidComponentException
QueryMetadataException
-
addToMetadataCache
public Object addToMetadataCache(Object metadataID, String key, Object value) throws TeiidComponentException, QueryMetadataException
- Specified by:
addToMetadataCache
in interfaceQueryMetadataInterface
- Throws:
TeiidComponentException
QueryMetadataException
-
getFromMetadataCache
public Object getFromMetadataCache(Object metadataID, String key) throws TeiidComponentException, QueryMetadataException
- Specified by:
getFromMetadataCache
in interfaceQueryMetadataInterface
- Throws:
TeiidComponentException
QueryMetadataException
-
isScalarGroup
public boolean isScalarGroup(Object groupID) throws TeiidComponentException, QueryMetadataException
- Specified by:
isScalarGroup
in interfaceQueryMetadataInterface
- Throws:
TeiidComponentException
QueryMetadataException
-
getFunctionLibrary
public FunctionLibrary getFunctionLibrary()
- Specified by:
getFunctionLibrary
in interfaceQueryMetadataInterface
-
getPrimaryKey
public Object getPrimaryKey(Object metadataID)
- Specified by:
getPrimaryKey
in interfaceQueryMetadataInterface
-
isMultiSource
public boolean isMultiSource(Object modelId)
- Specified by:
isMultiSource
in interfaceQueryMetadataInterface
-
isMultiSourceElement
public boolean isMultiSourceElement(Object elementId)
- Specified by:
isMultiSourceElement
in interfaceQueryMetadataInterface
-
getDesignTimeMetadata
public QueryMetadataInterface getDesignTimeMetadata()
Description copied from interface:QueryMetadataInterface
Get the metadata without visibility and session tables- Specified by:
getDesignTimeMetadata
in interfaceQueryMetadataInterface
- Returns:
-
hasProcedure
public boolean hasProcedure(String name) throws TeiidComponentException
Description copied from interface:QueryMetadataInterface
Return true if a procedure exists with the given name (partial or fqn)- Specified by:
hasProcedure
in interfaceQueryMetadataInterface
- Returns:
- Throws:
TeiidComponentException
-
getName
public String getName(Object metadataID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the name of the metadata identifier specified. This metadata identifier was previously returned by some other method.- Specified by:
getName
in interfaceQueryMetadataInterface
- Parameters:
metadataID
- Metadata identifier- Returns:
- Metadata identifier for this model
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
getSessionMetadata
public QueryMetadataInterface getSessionMetadata()
- Specified by:
getSessionMetadata
in interfaceQueryMetadataInterface
-
getImportedModels
public Set<String> getImportedModels()
- Specified by:
getImportedModels
in interfaceQueryMetadataInterface
-
getScriptEngine
public ScriptEngine getScriptEngine(String language) throws TeiidProcessingException
- Specified by:
getScriptEngine
in interfaceQueryMetadataInterface
- Parameters:
language
- null is treated as the default of 'javascript'- Returns:
- the ScriptEngine or null if the ScriptEngine is not available
- Throws:
TeiidProcessingException
- if the ScriptEngine is required
-
getScriptEngineDirect
public ScriptEngine getScriptEngineDirect(String language) throws TeiidProcessingException
- Parameters:
language
-- Returns:
- Throws:
TeiidProcessingException
-
isVariadic
public boolean isVariadic(Object metadataID)
- Specified by:
isVariadic
in interfaceQueryMetadataInterface
-
getFunctionBasedExpressions
public Map<Expression,Integer> getFunctionBasedExpressions(Object metadataID)
- Specified by:
getFunctionBasedExpressions
in interfaceQueryMetadataInterface
-
isPseudo
public boolean isPseudo(Object elementId)
- Specified by:
isPseudo
in interfaceQueryMetadataInterface
-
getModelID
public Object getModelID(String modelName) throws TeiidComponentException, QueryMetadataException
- Specified by:
getModelID
in interfaceQueryMetadataInterface
- Throws:
TeiidComponentException
QueryMetadataException
-
getExtensionProperty
public String getExtensionProperty(Object metadataID, String key, boolean checkUnqualified)
- Specified by:
getExtensionProperty
in interfaceQueryMetadataInterface
-
findShortName
public boolean findShortName()
- Specified by:
findShortName
in interfaceQueryMetadataInterface
-
useOutputName
public boolean useOutputName()
- Specified by:
useOutputName
in interfaceQueryMetadataInterface
-
widenComparisonToString
public boolean widenComparisonToString()
- Specified by:
widenComparisonToString
in interfaceQueryMetadataInterface
-
getDataTypeClass
public Class<?> getDataTypeClass(String typeName) throws QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the runtime type class for the given type name, which may include domains- Specified by:
getDataTypeClass
in interfaceQueryMetadataInterface
- Returns:
- Throws:
QueryMetadataException
-
isEnvAllowed
public boolean isEnvAllowed()
- Specified by:
isEnvAllowed
in interfaceQueryMetadataInterface
-
isLongRanks
public boolean isLongRanks()
- Specified by:
isLongRanks
in interfaceQueryMetadataInterface
-
getModelIDs
public List<? extends Object> getModelIDs()
- Specified by:
getModelIDs
in interfaceQueryMetadataInterface
-
getPushdownFunction
public FunctionMethod getPushdownFunction(Object modelID, String fullName)
- Specified by:
getPushdownFunction
in interfaceQueryMetadataInterface
-
-