com.ibm.websphere.sdo.mediator.jdbc.metadata
Interface Metadata


public interface Metadata

Metadata describes a set of database tables and how they map into an SDO DataGraph. Information from the Metadata is used to generate queries, determine the shape of a DataGraph, and construct a DataGraph.


Method Summary
 Relationship addRelationship(Key parentKey, Key childKey)
          Create and add a Relationship object with the given parentKey and childKey
 Table addTable(java.lang.String tableName)
          Create and add a Table object with the given tableName
 org.eclipse.emf.common.util.EList getOrderBys()
          Return the List of OrderBy objects contained in the Metadata
 Relationship getRelationship(java.lang.String name)
          Get the Relationship object with the specified name
 org.eclipse.emf.common.util.EList getRelationships()
          Returns the List of Relationship objects contained in the Metadata
 java.lang.String getRootObject()
          The Root Object attribute determines the type name associated with the root object in a DataGraph.
 Table getRootTable()
          Returns the root Table object
 Table getTable(java.lang.String tableName)
          Return the Table object with the given tableName
 Table getTableByPropertyName(java.lang.String propertyName)
          Return the Table object with the given propertyName
 org.eclipse.emf.common.util.EList getTables()
          Returns the List of Table objects contained in the Metadata
 int getUniqueKeyBufferSize()
          Return the value of the Unique Key Buffer Size attribute
 Table getUniqueKeyTable()
          Returns the Table used for generating unique keys.
 void save(java.io.OutputStream stream)
          Saves the current Metadata in XMI format to the given OutputStream
 void save(java.lang.String fileName)
          Saves the current Metadata in XMI format to the given file name
 void saveToEcore(java.io.OutputStream stream, java.lang.String prefix, java.lang.String packageName)
          Convert the current Metadata to an Ecore model and then save it to the given OutputStream
 void saveToEcore(java.lang.String fileName, java.lang.String prefix, java.lang.String packageName)
          Convert the current Metadata to an Ecore model and then save it to the given file name
 void setRootObject(java.lang.String value)
          Sets the value of the 'Root Object' attribute.
 void setRootTable(Table value)
          Sets the value of the 'Root Table' reference.
 void setUniqueKeyBufferSize(int value)
          Sets the value of the 'Unique Key Buffer Size' attribute.
 void setUniqueKeyTable(java.lang.String tableName)
          Sets the value of the 'Unique Key Table' containment reference.
 void setUniqueKeyTable(Table value)
          Sets the value of the 'Unique Key Table' containment reference.
 

Method Detail

getRootObject

public java.lang.String getRootObject()
The Root Object attribute determines the type name associated with the root object in a DataGraph. By default, this is DataGraphRoot.

Returns:
the name of the root object

setRootObject

public void setRootObject(java.lang.String value)
Sets the value of the 'Root Object' attribute.

Parameters:
value - the new value of the 'Root Object' attribute.
See Also:
getRootObject()

getUniqueKeyTable

public Table getUniqueKeyTable()
Returns the Table used for generating unique keys.

Returns:
the table used for generating unique keys

setUniqueKeyTable

public void setUniqueKeyTable(Table value)
Sets the value of the 'Unique Key Table' containment reference.

Parameters:
value - the new value of the 'Unique Key Table' containment reference.
See Also:
getUniqueKeyTable()

setUniqueKeyTable

public void setUniqueKeyTable(java.lang.String tableName)
Sets the value of the 'Unique Key Table' containment reference.

See Also:
getUniqueKeyTable()

getRootTable

public Table getRootTable()
Returns the root Table object

Returns:
the root table

setRootTable

public void setRootTable(Table value)
Sets the value of the 'Root Table' reference.

Parameters:
value - the new value of the 'Root Table' reference.
See Also:
getRootTable()

getTables

public org.eclipse.emf.common.util.EList getTables()
Returns the List of Table objects contained in the Metadata

Returns:
the list of tables

getRelationships

public org.eclipse.emf.common.util.EList getRelationships()
Returns the List of Relationship objects contained in the Metadata

Returns:
the list of relationships

getRelationship

public Relationship getRelationship(java.lang.String name)
Get the Relationship object with the specified name

Parameters:
name -
Returns:
a Relationship

addTable

public Table addTable(java.lang.String tableName)
Create and add a Table object with the given tableName

Parameters:
tableName -
Returns:
the new table

getTable

public Table getTable(java.lang.String tableName)
Return the Table object with the given tableName

Parameters:
tableName -
Returns:
the table

addRelationship

public Relationship addRelationship(Key parentKey,
                                    Key childKey)
Create and add a Relationship object with the given parentKey and childKey

Parameters:
parentKey - the relationship's parent key
childKey - the relationship's child key
Returns:
the new relationship

getOrderBys

public org.eclipse.emf.common.util.EList getOrderBys()
Return the List of OrderBy objects contained in the Metadata

Returns:
the list of OrderBy objects

getUniqueKeyBufferSize

public int getUniqueKeyBufferSize()
Return the value of the Unique Key Buffer Size attribute

Returns:
the unique key buffer size

setUniqueKeyBufferSize

public void setUniqueKeyBufferSize(int value)
Sets the value of the 'Unique Key Buffer Size' attribute.

Parameters:
value - the new value of the 'Unique Key Buffer Size' attribute.
See Also:
getUniqueKeyBufferSize()

getTableByPropertyName

public Table getTableByPropertyName(java.lang.String propertyName)
Return the Table object with the given propertyName

Returns:
the table

save

public void save(java.lang.String fileName)
          throws java.io.IOException
Saves the current Metadata in XMI format to the given file name

Parameters:
fileName - the name of the file
Throws:
java.io.IOException

save

public void save(java.io.OutputStream stream)
          throws java.io.IOException
Saves the current Metadata in XMI format to the given OutputStream

Parameters:
stream - the output stream to which the metadata will be saved
Throws:
java.io.IOException

saveToEcore

public void saveToEcore(java.lang.String fileName,
                        java.lang.String prefix,
                        java.lang.String packageName)
                 throws InvalidMetadataException,
                        java.io.IOException
Convert the current Metadata to an Ecore model and then save it to the given file name

Parameters:
fileName - the name of the file
prefix - the prefix for the Factory and Package objects
packageName - the package name
Throws:
java.io.IOException
InvalidMetadataException

saveToEcore

public void saveToEcore(java.io.OutputStream stream,
                        java.lang.String prefix,
                        java.lang.String packageName)
                 throws InvalidMetadataException,
                        java.io.IOException
Convert the current Metadata to an Ecore model and then save it to the given OutputStream

Parameters:
stream - the output stream
prefix - the prefix for the Factory and Package objects
packageName - the package name
Throws:
InvalidMetadataException
java.io.IOException