Package org.teiid.query.metadata
Class TempMetadataAdapter
- java.lang.Object
-
- org.teiid.query.metadata.BasicQueryMetadataWrapper
-
- org.teiid.query.metadata.TempMetadataAdapter
-
- All Implemented Interfaces:
QueryMetadataInterface
public class TempMetadataAdapter extends BasicQueryMetadataWrapper
This is an adapter class, it contains another instance of QueryMetadataInterface as well as a TempMetadataStore. It defers to either one of these when appropriate.
When a metadataID Object is requested for a group or element name, this will first check the QueryMetadataInterface. If an ID wasn't found there, it will then check the TempMetadataStore.
For methods that take a metadataID arg, this class may check whether it is a TempMetadataID or not and react accordingly.
-
-
Field Summary
Fields Modifier and Type Field Description static TempMetadataID
TEMP_MODEL
-
Fields inherited from class org.teiid.query.metadata.BasicQueryMetadataWrapper
actualMetadata, designTime, designTimeMetadata
-
Fields inherited from interface org.teiid.query.metadata.QueryMetadataInterface
UNKNOWN_CARDINALITY
-
-
Constructor Summary
Constructors Constructor Description TempMetadataAdapter(QueryMetadataInterface metadata, TempMetadataStore tempStore)
TempMetadataAdapter(QueryMetadataInterface metadata, TempMetadataStore tempStore, Map<Object,Object> materializationTables, Map<Object,QueryNode> queryNodes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
addToMetadataCache(Object metadataID, String key, Object value)
protected QueryMetadataInterface
createDesignTimeMetadata()
boolean
elementSupports(Object elementID, int supportConstant)
Determine whether the specified element supports some feature.Collection
getAccessPatternsInGroup(Object groupID)
Get the access patterns for the specified groupstatic Object
getActualMetadataId(Object id)
float
getCardinality(Object groupID)
Return the cardinality for this groupString
getDefaultValue(Object elementID)
Get the element's default value for an element symbolfloat
getDistinctValues(Object elementID)
Get the number of distinct values for this column.Object
getElementID(String elementName)
Check metadata first, then check temp groups if not foundList
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 keyID)
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 groupObject
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)
Object
getGroupID(String groupName)
Check metadata first, then check temp groups if not foundObject
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.Collection
getIndexesInGroup(Object groupID)
Get the indexes for the specified groupObject
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 symbolQueryMetadataInterface
getMetadata()
TempMetadataStore
getMetadataStore()
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.String
getName(Object metadataID)
Get the name of the metadata identifier specified.String
getNativeType(Object elementID)
Get the native type name for the element.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 IDint
getRadix(Object elementID)
Get the element's radixint
getScale(Object elementID)
Get the element's scaleQueryMetadataInterface
getSessionMetadata()
Collection
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
getVirtualDatabaseName()
Get the currently connected virtual database name.QueryNode
getVirtualPlan(Object groupID)
Get virtual plan for a group symbol.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
isMultiSource(Object modelId)
boolean
isMultiSourceElement(Object elementId)
boolean
isProcedure(Object elementID)
Determine whether this is a procedureboolean
isScalarGroup(Object groupID)
boolean
isSession()
boolean
isTemporaryTable(Object groupID)
Determine whether a group is a temporary table.boolean
isVirtualGroup(Object groupID)
Determine whether a group is virtual or not.boolean
isVirtualModel(Object modelID)
Determine whether a model is virtual or not.void
setSession(boolean session)
-
Methods inherited from class org.teiid.query.metadata.BasicQueryMetadataWrapper
findShortName, getBinaryVDBResource, getCharacterVDBResource, getDataTypeClass, getDeletePlan, getDesignTimeMetadata, getFormat, getFunctionLibrary, getImportedModels, getInsertPlan, getMaxSetSize, getModelID, getModelIDs, getNameInSource, getPushdownFunction, getScriptEngine, getStoredProcedureInfoForProcedure, getUpdatePlan, getVDBResourcePaths, hasProcedure, isEnvAllowed, isLongRanks, isPseudo, isVariadic, modelSupports, useOutputName, widenComparisonToString
-
-
-
-
Field Detail
-
TEMP_MODEL
public static final TempMetadataID TEMP_MODEL
-
-
Constructor Detail
-
TempMetadataAdapter
public TempMetadataAdapter(QueryMetadataInterface metadata, TempMetadataStore tempStore)
-
TempMetadataAdapter
public TempMetadataAdapter(QueryMetadataInterface metadata, TempMetadataStore tempStore, Map<Object,Object> materializationTables, Map<Object,QueryNode> queryNodes)
-
-
Method Detail
-
isSession
public boolean isSession()
-
setSession
public void setSession(boolean session)
-
getSessionMetadata
public QueryMetadataInterface getSessionMetadata()
- Specified by:
getSessionMetadata
in interfaceQueryMetadataInterface
- Overrides:
getSessionMetadata
in classBasicQueryMetadataWrapper
-
createDesignTimeMetadata
protected QueryMetadataInterface createDesignTimeMetadata()
- Overrides:
createDesignTimeMetadata
in classBasicQueryMetadataWrapper
-
getMetadataStore
public TempMetadataStore getMetadataStore()
-
getMetadata
public QueryMetadataInterface getMetadata()
-
getElementID
public Object getElementID(String elementName) throws TeiidComponentException, QueryMetadataException
Check metadata first, then check temp groups if not found- Specified by:
getElementID
in interfaceQueryMetadataInterface
- Overrides:
getElementID
in classBasicQueryMetadataWrapper
- 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
-
getGroupID
public Object getGroupID(String groupName) throws TeiidComponentException, QueryMetadataException
Check metadata first, then check temp groups if not found- Specified by:
getGroupID
in interfaceQueryMetadataInterface
- Overrides:
getGroupID
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getGroupsForPartialName
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getModelID
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getFullName
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getName
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getElementIDsInGroupID
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getGroupIDForElementID
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getElementRuntimeTypeName
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getDefaultValue
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getMaximumValue
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getMinimumValue
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getDistinctValues
in classBasicQueryMetadataWrapper
- 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- 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
- Overrides:
getNullValues
in classBasicQueryMetadataWrapper
- 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- See Also:
QueryMetadataInterface.getNullValues(java.lang.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
- Overrides:
getVirtualPlan
in classBasicQueryMetadataWrapper
- Parameters:
groupID
- Group- Returns:
- Root of tree of QueryNode objects
- Throws:
TeiidComponentException
QueryMetadataException
-
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
- Overrides:
isVirtualGroup
in classBasicQueryMetadataWrapper
- Parameters:
groupID
- Group symbol- Returns:
- True if virtual
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
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
- Overrides:
hasMaterialization
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getMaterialization
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getMaterializationStage
in classBasicQueryMetadataWrapper
- 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
- Overrides:
isVirtualModel
in classBasicQueryMetadataWrapper
- Parameters:
modelID
- model symbol- Returns:
- True if virtual
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request
-
elementSupports
public boolean elementSupports(Object elementID, int supportConstant) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Determine whether the specified element supports some feature.- Specified by:
elementSupports
in interfaceQueryMetadataInterface
- Overrides:
elementSupports
in classBasicQueryMetadataWrapper
- Parameters:
elementID
- Element metadata IDsupportConstant
- 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
-
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
- Overrides:
getIndexesInGroup
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getUniqueKeysInGroup
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getForeignKeysInGroup
in classBasicQueryMetadataWrapper
- 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
-
getElementIDsInKey
public List getElementIDsInKey(Object keyID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the elements in the key- Specified by:
getElementIDsInKey
in interfaceQueryMetadataInterface
- Overrides:
getElementIDsInKey
in classBasicQueryMetadataWrapper
- Parameters:
keyID
- 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
-
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
- Overrides:
getPrimaryKeyIDForForeignKeyID
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
groupSupports
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getVirtualDatabaseName
in classBasicQueryMetadataWrapper
- 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()
-
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
- Overrides:
getAccessPatternsInGroup
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getElementIDsInAccessPattern
in classBasicQueryMetadataWrapper
- 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)
-
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
- Overrides:
getCardinality
in classBasicQueryMetadataWrapper
- Parameters:
groupID
- Metadata identifier specifying group- Returns:
- cardinality for the given group. If unknown, return UNKNOWN_CARDINALITY.
- Throws:
TeiidComponentException
QueryMetadataException
-
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
- Overrides:
getExtensionProperties
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getElementLength
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
getPosition
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getPrecision
in classBasicQueryMetadataWrapper
- 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
- Overrides:
getRadix
in classBasicQueryMetadataWrapper
- 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
-
getScale
public int getScale(Object elementID) throws TeiidComponentException, QueryMetadataException
Description copied from interface:QueryMetadataInterface
Get the element's scale- Specified by:
getScale
in interfaceQueryMetadataInterface
- Overrides:
getScale
in classBasicQueryMetadataWrapper
- 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
-
getNativeType
public String getNativeType(Object elementID) throws TeiidComponentException, QueryMetadataException
Get the native type name for the element.- Specified by:
getNativeType
in interfaceQueryMetadataInterface
- Overrides:
getNativeType
in classBasicQueryMetadataWrapper
- Parameters:
elementID
- Element identifier- Returns:
- Native type name
- Throws:
QueryMetadataException
- Metadata implementation detected a problem during the requestTeiidComponentException
- Unexpected internal system problem during request- Since:
- 4.2
- See Also:
QueryMetadataInterface.getNativeType(java.lang.Object)
-
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
- Overrides:
isProcedure
in classBasicQueryMetadataWrapper
- 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
-
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
- Overrides:
isTemporaryTable
in classBasicQueryMetadataWrapper
- 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
- Overrides:
addToMetadataCache
in classBasicQueryMetadataWrapper
- Throws:
TeiidComponentException
QueryMetadataException
-
getFromMetadataCache
public Object getFromMetadataCache(Object metadataID, String key) throws TeiidComponentException, QueryMetadataException
- Specified by:
getFromMetadataCache
in interfaceQueryMetadataInterface
- Overrides:
getFromMetadataCache
in classBasicQueryMetadataWrapper
- Throws:
TeiidComponentException
QueryMetadataException
-
isScalarGroup
public boolean isScalarGroup(Object groupID) throws TeiidComponentException, QueryMetadataException
- Specified by:
isScalarGroup
in interfaceQueryMetadataInterface
- Overrides:
isScalarGroup
in classBasicQueryMetadataWrapper
- Throws:
TeiidComponentException
QueryMetadataException
-
getPrimaryKey
public Object getPrimaryKey(Object metadataID)
- Specified by:
getPrimaryKey
in interfaceQueryMetadataInterface
- Overrides:
getPrimaryKey
in classBasicQueryMetadataWrapper
-
isMultiSource
public boolean isMultiSource(Object modelId) throws QueryMetadataException, TeiidComponentException
- Specified by:
isMultiSource
in interfaceQueryMetadataInterface
- Overrides:
isMultiSource
in classBasicQueryMetadataWrapper
- Throws:
QueryMetadataException
TeiidComponentException
-
isMultiSourceElement
public boolean isMultiSourceElement(Object elementId) throws QueryMetadataException, TeiidComponentException
- Specified by:
isMultiSourceElement
in interfaceQueryMetadataInterface
- Overrides:
isMultiSourceElement
in classBasicQueryMetadataWrapper
- Throws:
QueryMetadataException
TeiidComponentException
-
getFunctionBasedExpressions
public Map<Expression,Integer> getFunctionBasedExpressions(Object metadataID)
- Specified by:
getFunctionBasedExpressions
in interfaceQueryMetadataInterface
- Overrides:
getFunctionBasedExpressions
in classBasicQueryMetadataWrapper
-
getExtensionProperty
public String getExtensionProperty(Object metadataID, String key, boolean checkUnqualified)
- Specified by:
getExtensionProperty
in interfaceQueryMetadataInterface
- Overrides:
getExtensionProperty
in classBasicQueryMetadataWrapper
-
-