public class MetadataFactory extends NamespaceContainer
| Modifier and Type | Field and Description |
|---|---|
protected int |
count |
ACCUMULO_URI, BUILTIN_NAMESPACES, COUCHBASE_URI, EXCEL_URI, HBASE_URI, INFINISPAN_URI, JPA_URI, LDAP_URI, MONGO_URI, namespaces, ODATA_URI, PI_URI, REST_URI, SF_URI, SPATIAL_URI, WS_URI| Constructor and Description |
|---|
MetadataFactory(String vdbName,
Object vdbVersion,
Map<String,Datatype> runtimeTypes,
org.teiid.adminapi.impl.ModelMetaData model) |
MetadataFactory(String vdbName,
Object vdbVersion,
String schemaName,
Map<String,Datatype> runtimeTypes,
Properties modelProperties,
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 |
addColumnPermission(String role,
Column resource,
Boolean allowCreate,
Boolean allowRead,
Boolean allowUpdate,
String condition,
String mask,
Integer order)
Add a permission for a
Column |
ForeignKey |
addForeignKey(String name,
List<String> columnNames,
List<String> referencedColumnNames,
String referenceTable,
Table table)
Adds a foreign key to the given table.
|
ForeignKey |
addForeignKey(String name,
List<String> columnNames,
String referenceTable,
Table table)
Adds a foreign key to the given table.
|
ForeignKey |
addForiegnKey(String name,
List<String> columnNames,
List<String> referencedColumnNames,
String referenceTable,
Table table)
Deprecated.
|
ForeignKey |
addForiegnKey(String name,
List<String> columnNames,
String referenceTable,
Table table)
Deprecated.
|
void |
addFunction(FunctionMethod functionMethod) |
FunctionMethod |
addFunction(String name)
Add a function with the given name to the model.
|
FunctionMethod |
addFunction(String name,
Method method)
Adds a non-pushdown function based upon the given
Method. |
FunctionMethod |
addFunction(String name,
String returnType,
String... paramTypes)
Add a function with the given name to the model.
|
KeyRecord |
addFunctionBasedIndex(String name,
List<String> expressions,
List<Boolean> nonColumnExpressions,
Table table)
Adds a function based index on the given expressions.
|
KeyRecord |
addIndex(String name,
boolean nonUnique,
List<String> columnNames,
Table table)
Adds an index to the given table.
|
void |
addPermission(String role,
AbstractMetadataRecord resource,
Boolean allowAlter,
Boolean allowCreate,
Boolean allowRead,
Boolean allowUpdate,
Boolean allowDelete,
Boolean allowExecute,
String condition,
Boolean constraint)
|
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.
|
void |
addSchemaPermission(String role,
Boolean allowAlter,
Boolean allowCreate,
Boolean allowRead,
Boolean allowUpdate,
Boolean allowDelete,
Boolean allowExecute)
Add a permission for the current
Schema which will typically act as a default for all child objects. |
Table |
addTable(String name)
Add a table with the given name to the model.
|
MetadataStore |
asMetadataStore() |
void |
correctDatatypes(Map<String,Datatype> dt)
To be called if the MetadataFactory is deserialized to set the canonical system
type value.
|
static FunctionMethod |
createFunctionFromMethod(String name,
Method method) |
Map<String,Datatype> |
getDataTypes()
get runtime types keyed by runtime name, which is
a type name known to the Teiid engine
|
Properties |
getImportProperties()
Deprecated.
|
org.teiid.adminapi.Model |
getModel() |
Properties |
getModelProperties() |
String |
getName() |
Map<String,String> |
getNamespaces()
Get the namespace map.
|
Parser |
getParser() |
String |
getRawMetadata()
Deprecated.
|
Schema |
getSchema() |
String |
getVdbName() |
Map<String,? extends VDBResource> |
getVDBResources() |
String |
getVdbVersion() |
static String |
hex(long val,
int hexLength) |
void |
mergeInto(MetadataStore store) |
void |
parse(Reader ddl)
Parses, but does not close, the given
Reader into this MetadataFactory |
Column |
renameColumn(String oldName,
String name,
ColumnSet<?> table) |
ProcedureParameter |
renameParameter(String oldName,
String name,
Procedure procedure) |
void |
setAutoCorrectColumnNames(boolean autoCorrectColumnNames)
Set to false to disable correcting column and other names to be valid Teiid names.
|
static Datatype |
setDataType(String type,
BaseColumn column,
Map<String,Datatype> dataTypes,
boolean allowNull) |
void |
setModel(org.teiid.adminapi.impl.ModelMetaData model) |
void |
setParser(Parser parser) |
void |
setSchema(Schema schema)
Set the
Schema to a different instance. |
protected void |
setUUID(AbstractMetadataRecord record) |
void |
setVdbResources(Map<String,? extends VDBResource> vdbResources) |
addNamespace, resolvePropertyKeypublic MetadataFactory(String vdbName, Object vdbVersion, Map<String,Datatype> runtimeTypes, org.teiid.adminapi.impl.ModelMetaData model)
public static String hex(long val, int hexLength)
@Deprecated public Properties getImportProperties()
getModelProperties()public Properties getModelProperties()
@Deprecated public String getRawMetadata()
public org.teiid.adminapi.Model getModel()
protected void setUUID(AbstractMetadataRecord record)
public String getName()
public Schema getSchema()
public Table addTable(String name)
name - MetadataExceptionpublic Column addColumn(String name, String type, ColumnSet<?> table)
name - type - should be one of TypeFacility.RUNTIME_NAMEStable - MetadataExceptionpublic ProcedureParameter renameParameter(String oldName, String name, Procedure procedure)
public static Datatype setDataType(String type, BaseColumn column, Map<String,Datatype> dataTypes, boolean allowNull)
public KeyRecord addPrimaryKey(String name, List<String> columnNames, Table table)
name - columnNames - table - MetadataExceptionpublic KeyRecord addAccessPattern(String name, List<String> columnNames, Table table)
name - columnNames - table - MetadataExceptionpublic KeyRecord addIndex(String name, boolean nonUnique, List<String> columnNames, Table table)
name - nonUnique - true indicates that an index is being added.columnNames - table - MetadataExceptionpublic KeyRecord addFunctionBasedIndex(String name, List<String> expressions, List<Boolean> nonColumnExpressions, Table table)
name - expressions - nonColumnExpressions - a Boolean list indicating when expressions are non-column expressionstable - MetadataExceptionpublic ForeignKey addForeignKey(String name, List<String> columnNames, String referenceTable, Table table)
name - columnNames - referenceTable - - schema qualified reference table nametable - MetadataException@Deprecated public ForeignKey addForiegnKey(String name, List<String> columnNames, String referenceTable, Table table)
public ForeignKey addForeignKey(String name, List<String> columnNames, List<String> referencedColumnNames, String referenceTable, Table table)
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.MetadataException@Deprecated public ForeignKey addForiegnKey(String name, List<String> columnNames, List<String> referencedColumnNames, String referenceTable, Table table)
public Procedure addProcedure(String name)
name - MetadataExceptionpublic ProcedureParameter addProcedureParameter(String name, String type, ProcedureParameter.Type parameterType, Procedure procedure)
name - type - should be one of TypeFacility.RUNTIME_NAMESparameterType - should be one of ProcedureParameter.Typeprocedure - MetadataExceptionpublic Column addProcedureResultSetColumn(String name, String type, Procedure procedure)
name - type - should be one of TypeFacility.RUNTIME_NAMESprocedure - MetadataExceptionpublic FunctionMethod addFunction(String name)
name - MetadataExceptionpublic FunctionMethod addFunction(String name, String returnType, String... paramTypes)
name - MetadataExceptionpublic FunctionMethod addFunction(String name, Method method)
Method.name - method - MetadataExceptionpublic static FunctionMethod createFunctionFromMethod(String name, Method method)
public void setAutoCorrectColumnNames(boolean autoCorrectColumnNames)
autoCorrectColumnNames - public void mergeInto(MetadataStore store)
public MetadataStore asMetadataStore()
public void setSchema(Schema schema)
Schema to a different instance. This is typically called
in special situations where the MetadataFactory logic is not used
to construct the Schema.schema - public Map<String,Datatype> getDataTypes()
public void correctDatatypes(Map<String,Datatype> dt)
dt - builtin - public String getVdbName()
public String getVdbVersion()
public Map<String,String> getNamespaces()
NamespaceContainer.addNamespace(String, String)
has not been called successfully.getNamespaces in class NamespaceContainerpublic void parse(Reader ddl) throws MetadataException
Reader into this MetadataFactoryddl - MetadataExceptionpublic void setParser(Parser parser)
public void setModel(org.teiid.adminapi.impl.ModelMetaData model)
public Parser getParser()
public Map<String,? extends VDBResource> getVDBResources()
public void setVdbResources(Map<String,? extends VDBResource> vdbResources)
public void addPermission(String role, AbstractMetadataRecord resource, Boolean allowAlter, Boolean allowCreate, Boolean allowRead, Boolean allowUpdate, Boolean allowDelete, Boolean allowExecute, String condition, Boolean constraint)
role - resource - allowAlter - allowCreate - allowRead - allowUpdate - allowDelete - allowExecute - condition - constraint - public void addSchemaPermission(String role, Boolean allowAlter, Boolean allowCreate, Boolean allowRead, Boolean allowUpdate, Boolean allowDelete, Boolean allowExecute)
Schema which will typically act as a default for all child objects.role - allowAlter - allowCreate - allowRead - allowUpdate - allowDelete - allowExecute - public void addColumnPermission(String role, Column resource, Boolean allowCreate, Boolean allowRead, Boolean allowUpdate, String condition, String mask, Integer order)
Columnrole - resource - allowCreate - allowRead - allowUpdate - condition - mask - order - public void addFunction(FunctionMethod functionMethod)
Copyright © 2018 JBoss by Red Hat. All rights reserved.