public class MetadataFactory extends Schema
AbstractMetadataRecord.DataModifiable, AbstractMetadataRecord.ModifiableNAME_DELIM_CHAR, RELATIONAL_URI| Constructor and Description |
|---|
MetadataFactory(String vdbName,
int vdbVersion,
String schemaName,
Map<String,Datatype> dataTypes,
Properties importProperties,
String rawMetadata) |
| Modifier and Type | Method and Description |
|---|---|
KeyRecord |
addAccessPattern(String name,
List<String> columnNames,
Table table)
Adds an access pattern to the given table.
|
Column |
addColumn(String name,
String type,
ColumnSet<?> table)
Adds a column to the table with the given name and type.
|
void |
addDatatype(Datatype datatype) |
ForeignKey |
addForiegnKey(String name,
List<String> columnNames,
List<String> referencedColumnNames,
String referenceTable,
Table table)
Adds a foreign key to the given table.
|
ForeignKey |
addForiegnKey(String name,
List<String> columnNames,
String referenceTable,
Table table)
Adds a foreign key to the given table.
|
FunctionMethod |
addFunction(String name)
Add a function with the given name to the model.
|
KeyRecord |
addIndex(String name,
boolean nonUnique,
List<String> columnNames,
Table table)
Adds an index to the given table.
|
void |
addNamespace(String prefix,
String uri) |
KeyRecord |
addPrimaryKey(String name,
List<String> columnNames,
Table table)
Adds a primary key to the given table.
|
Procedure |
addProcedure(String name)
Add a procedure with the given name to the model.
|
ProcedureParameter |
addProcedureParameter(String name,
String type,
ProcedureParameter.Type parameterType,
Procedure procedure)
Add a procedure parameter.
|
Column |
addProcedureResultSetColumn(String name,
String type,
Procedure procedure)
Add a procedure resultset column to the given procedure.
|
Table |
addTable(String name)
Add a table with the given name to the model.
|
MetadataStore |
asMetadataStore() |
Map<String,Datatype> |
getDataTypes() |
Properties |
getImportProperties() |
Map<String,String> |
getNamespaces() |
String |
getRawMetadata() |
String |
getVdbName() |
int |
getVdbVersion() |
void |
mergeFrom(Schema schema) |
void |
mergeInto(MetadataStore store) |
void |
setAutoCorrectColumnNames(boolean autoCorrectColumnNames)
Set to false to disable correcting column and other names to be valid Teiid names.
|
protected void |
setUUID(AbstractMetadataRecord record) |
addFunction, addProcedure, addTable, getFunction, getFunctions, getPrimaryMetamodelUri, getProcedure, getProcedures, getTable, getTables, isPhysical, isVisible, setPhysical, setPrimaryMetamodelUri, setVisibleequals, getAnnotation, getCanonicalName, getFullName, getName, getNameInSource, getParent, getProperties, getProperty, getUUID, hashCode, setAnnotation, setName, setNameInSource, setProperties, setProperty, setUUID, toStringpublic Properties getImportProperties()
public String getRawMetadata()
protected void setUUID(AbstractMetadataRecord record)
public Table addTable(String name) throws TranslatorException
name - TranslatorExceptionpublic Column addColumn(String name, String type, ColumnSet<?> table) throws TranslatorException
name - type - should be one of TypeFacility.RUNTIME_NAMEStable - TranslatorExceptionpublic KeyRecord addPrimaryKey(String name, List<String> columnNames, Table table) throws TranslatorException
name - columnNames - table - TranslatorExceptionpublic KeyRecord addAccessPattern(String name, List<String> columnNames, Table table) throws TranslatorException
name - columnNames - table - TranslatorExceptionpublic KeyRecord addIndex(String name, boolean nonUnique, List<String> columnNames, Table table) throws TranslatorException
name - nonUnique - true indicates that an index is being added.columnNames - table - TranslatorExceptionpublic ForeignKey addForiegnKey(String name, List<String> columnNames, String referenceTable, Table table) throws TranslatorException
name - columnNames - referenceTable - - schema qualified reference table nametable - TranslatorExceptionpublic ForeignKey addForiegnKey(String name, List<String> columnNames, List<String> referencedColumnNames, String referenceTable, Table table) throws TranslatorException
name - columnNames - referencedColumnNames, - may be null to indicate that the primary key should be used.referenceTable - - schema qualified reference table name, can be from another schematable - addUniqueConstraint - - if true, if the referenced table columns do not match with either PK, or FK then a UNIQUE index on reference table is created.TranslatorExceptionpublic Procedure addProcedure(String name) throws TranslatorException
name - TranslatorExceptionpublic ProcedureParameter addProcedureParameter(String name, String type, ProcedureParameter.Type parameterType, Procedure procedure) throws TranslatorException
name - type - should be one of TypeFacility.RUNTIME_NAMESparameterType - should be one of ProcedureParameter.Typeprocedure - TranslatorExceptionpublic Column addProcedureResultSetColumn(String name, String type, Procedure procedure) throws TranslatorException
name - type - should be one of TypeFacility.RUNTIME_NAMESprocedure - TranslatorExceptionpublic FunctionMethod addFunction(String name) throws TranslatorException
name - TranslatorExceptionpublic void setAutoCorrectColumnNames(boolean autoCorrectColumnNames)
autoCorrectColumnNames - public void mergeInto(MetadataStore store)
public MetadataStore asMetadataStore()
public void mergeFrom(Schema schema)
public void addDatatype(Datatype datatype)
public String getVdbName()
public int getVdbVersion()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.