org.teiid.query.metadata
Class TempMetadataID

java.lang.Object
  extended by org.teiid.query.metadata.TempMetadataID
All Implemented Interfaces:
Serializable, AbstractMetadataRecord.DataModifiable, AbstractMetadataRecord.Modifiable

public class TempMetadataID
extends Object
implements Serializable, AbstractMetadataRecord.Modifiable, AbstractMetadataRecord.DataModifiable

This class represents a temporary metadata ID. A temporary metadata ID does not exist in a real metadata source. Rather, it is used temporarily in context of processing a single query. This metadata ID can be used to represent either a group or an element depending on the constructor used. TODO: we should be using the real metadata objects, but internal and designer legacy keep us on the temp framework

See Also:
Serialized Form

Nested Class Summary
static class TempMetadataID.TableData
           
static class TempMetadataID.Type
           
 
Constructor Summary
TempMetadataID(String ID, Class<?> type)
          Constructor for element form of metadata ID.
TempMetadataID(String ID, Class<?> type, Object metadataID)
          Constructor for element form of metadata ID with the underlying element.
TempMetadataID(String ID, List<TempMetadataID> elements)
          Constructor for group form of metadata ID.
TempMetadataID(String ID, List<TempMetadataID> elements, TempMetadataID.Type type)
          Constructor for group form of metadata ID.
 
Method Summary
protected  void addElement(TempMetadataID elem)
          add a element to the temp table.
 void addIndex(List<TempMetadataID> index)
           
 void addUniqueKey(List<TempMetadataID> key)
           
 boolean equals(Object obj)
          Compare this temp metadata ID with another object.
 Collection<TempMetadataID> getAccessPatterns()
           
 CacheHint getCacheHint()
           
 int getCardinality()
           
 List<TempMetadataID> getElements()
          Get elements - only valid for groups
 String getID()
          Get ID value
 List<List<TempMetadataID>> getIndexes()
           
 long getLastDataModification()
           
 long getLastModified()
           
 TempMetadataID.Type getMetadataType()
           
 String getName()
           
 Object getOriginalMetadataID()
           
 int getPosition()
           
 List<TempMetadataID> getPrimaryKey()
           
 QueryNode getQueryNode()
           
 TempMetadataID.TableData getTableData()
           
 Class<?> getType()
          Get type - only valid for elements
 List<List<TempMetadataID>> getUniqueKeys()
           
 int hashCode()
          Return hash code
 boolean isAutoIncrement()
           
 boolean isNotNull()
           
 boolean isScalarGroup()
           
 boolean isTempTable()
          Whether it is a temporary table
 boolean isUpdatable()
           
 boolean isVirtual()
          Check whether this group is virtual
 void setAccessPatterns(Collection<TempMetadataID> accessPatterns)
           
 void setAutoIncrement(boolean autoIncrement)
           
 void setCacheHint(CacheHint cacheHint)
           
 void setCardinality(int cardinality)
           
 void setMetadataType(TempMetadataID.Type metadataType)
           
 void setNotNull(boolean notNull)
           
 void setOriginalMetadataID(Object metadataId)
           
 void setPosition(int position)
           
 void setPrimaryKey(List<TempMetadataID> primaryKey)
           
 void setQueryNode(QueryNode queryNode)
           
 void setTempTable(boolean isTempTable)
           
 void setUpdatable(boolean updatable)
           
 String toString()
          Return string representation of ID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TempMetadataID

public TempMetadataID(String ID,
                      List<TempMetadataID> elements)
Constructor for group form of metadata ID.

Parameters:
ID - Fully-qualified, upper-case name of ID
elements - List of TempMetadataID representing elements

TempMetadataID

public TempMetadataID(String ID,
                      List<TempMetadataID> elements,
                      TempMetadataID.Type type)
Constructor for group form of metadata ID.

Parameters:
ID - Fully-qualified, upper-case name of ID
elements - List of TempMetadataID representing elements
isVirtual - whether or not the group is a virtual group

TempMetadataID

public TempMetadataID(String ID,
                      Class<?> type)
Constructor for element form of metadata ID.

Parameters:
ID - Fully-qualified, upper-case name of ID
type - Type of elements List of TempMetadataID representing elements

TempMetadataID

public TempMetadataID(String ID,
                      Class<?> type,
                      Object metadataID)
Constructor for element form of metadata ID with the underlying element.

Parameters:
ID - Fully-qualified, upper-case name of ID
type - Type of elements List of TempMetadataID representing elements
metadataID - the orginal metadataID
Method Detail

getLastDataModification

public long getLastDataModification()
Specified by:
getLastDataModification in interface AbstractMetadataRecord.DataModifiable

getLastModified

public long getLastModified()
Specified by:
getLastModified in interface AbstractMetadataRecord.Modifiable

getID

public String getID()
Get ID value

Returns:
ID value

getType

public Class<?> getType()
Get type - only valid for elements

Returns:
Type for elements, null for groups

getElements

public List<TempMetadataID> getElements()
Get elements - only valid for groups

Returns:
List of TempMetadataID for groups, null for elements

addElement

protected void addElement(TempMetadataID elem)
add a element to the temp table.

Parameters:
elem -

isVirtual

public boolean isVirtual()
Check whether this group is virtual

Returns:
True if virtual

isTempTable

public boolean isTempTable()
Whether it is a temporary table

Returns:
Since:
5.5

toString

public String toString()
Return string representation of ID

Overrides:
toString in class Object
Returns:
String representation

equals

public boolean equals(Object obj)
Compare this temp metadata ID with another object.

Overrides:
equals in class Object
Returns:
True if obj is another TempMetadataID with same ID value

hashCode

public int hashCode()
Return hash code

Overrides:
hashCode in class Object
Returns:
Hash code value for object

setOriginalMetadataID

public void setOriginalMetadataID(Object metadataId)

getOriginalMetadataID

public Object getOriginalMetadataID()
Returns:
Returns the originalMetadataID.
Since:
4.3

getAccessPatterns

public Collection<TempMetadataID> getAccessPatterns()

setAccessPatterns

public void setAccessPatterns(Collection<TempMetadataID> accessPatterns)

getCardinality

public int getCardinality()

setCardinality

public void setCardinality(int cardinality)

setTempTable

public void setTempTable(boolean isTempTable)

isScalarGroup

public boolean isScalarGroup()

setMetadataType

public void setMetadataType(TempMetadataID.Type metadataType)

getMetadataType

public TempMetadataID.Type getMetadataType()

getPrimaryKey

public List<TempMetadataID> getPrimaryKey()

setPrimaryKey

public void setPrimaryKey(List<TempMetadataID> primaryKey)

getPosition

public int getPosition()

setPosition

public void setPosition(int position)

getQueryNode

public QueryNode getQueryNode()

setQueryNode

public void setQueryNode(QueryNode queryNode)

getCacheHint

public CacheHint getCacheHint()

setCacheHint

public void setCacheHint(CacheHint cacheHint)

getIndexes

public List<List<TempMetadataID>> getIndexes()

addIndex

public void addIndex(List<TempMetadataID> index)

getUniqueKeys

public List<List<TempMetadataID>> getUniqueKeys()

addUniqueKey

public void addUniqueKey(List<TempMetadataID> key)

getTableData

public TempMetadataID.TableData getTableData()

isAutoIncrement

public boolean isAutoIncrement()

setAutoIncrement

public void setAutoIncrement(boolean autoIncrement)

isNotNull

public boolean isNotNull()

setNotNull

public void setNotNull(boolean notNull)

setUpdatable

public void setUpdatable(boolean updatable)

isUpdatable

public boolean isUpdatable()

getName

public String getName()


Copyright © 2011. All Rights Reserved.