JBoss.orgCommunity Documentation

Chapter 5. Metadata-specific Modeling

5.1. Relational Source Modeling
5.1.1. Source Function
5.1.2. Create Relational Table Wizard
5.2. Relational View Modeling
5.2.1. Create Materialized Views
5.3. XML Document Modeling
5.3.1. Create XML View Documents from schema
5.4. Web Services Modeling
5.4.1. Create Web Service Action
5.4.2. Web Services War Generation

This chapter discusses various features targeted at defining and managing metamodel-specific objects.

In Teiid Designer 7.6 a new action, New Child > Base Table..., was added to aid in creating tables, complete with all of it's child entities. This action is in addition to the original New Child > Base Table, which only creates the empty table (and requires numerous separate steps to add it's children)


Running the action will display the Create Relational Table wizard. The wizard page contains 5 tabbed panels representing the various properties and components that make up the possible definition of a relational table. Enter your database function name, define input parameters including datatype and length, specify output parameter info, set options and click OK.

This wizard is designed to provide feedback as to the completeness of the relational table information as well as the validation state of the table and it's components. Note that although errors may be displayed during editing, the wizard is designed to allow finishing with the construction of an incomplete table containing errors.

The first tab labeled Properties contains the input for the simple table properties including name, name in source, cardinality, supports update and is system table properties.


The Columns tab allows creation and editing of basic relational columns. This includes adding, deleting or moving columns as well as changing the name, datatype and length properties.


The Primary Key tab allows editing of the name, name in source and column definitions. Note that un-checking the box will clear the data. The Unique Constraint tab contains the identical information.


The Foreign Keys tab allows creating, editing and deleting multiple foreign keys.


To create a new Foreign Key, select the Add button and enter/select the properties, key references in the tables shown below. Note the Select Primary Key or Unique Constraint table will display any PK/UC existing in the selected relational model. If no tables in that model contain a PK or UC, then the table will be empty.


This section contains descriptions of various features related to creating and managing relational view model objects.

For any relational view table you can enable it's materialized view option by setting the Materialized property to TRUE and setting the Materialized Table reference, as shown in the figure below. Note that you are required to have already created your relational tables.


Designer includes a feature to assist in quickly creating materialized relational tables based on your existing view tables.

  • To create materialized views:

    • Step 1 - Right-click on one or more view tables in the Section 10.2.1, “Model Explorer View” and select the Modeling > Create Materialized Views action.

    • Step 2 - In the Create Materialized View Model dialog specify or select a target relational model for your generated relational tables.

    • Step 2a - Selecting the browse '...' button displays the Relational Model Selector dialog where you select an existing relational model or specify a unique name for a new model.

    • Step 3 - Click OK to create relational tables corresponding to your selected view tables and automatically set the Materialized property to TRUE and the Materialized Table reference value to your newly generated table.

When finished your view tables will be configured with their new materialized properties and the corresponding relational tables will be shown in their package diagram.


Teiid Designer allows you to expose your VDBs via a SOAP or REST interface. JBossWS-CXF or RESTEasy wars can be generated based on models within your VDBs. This section describes these wizards in detail.

The Teiid Designer provides web service generation capabilities in the form of a JBossWS-CXF war. Once you have added your Web Service Models as described in Section 2.5, “Creating Web Service View Model” to your VDB, deployed the VDB to a running Teiid instance and created your VDB's data source, you are ready to expose the web service using the generated war.

In Teiid Designer, it is also possible to expose your VDBs over REST using a generated RESTEasy war. Also, if your target virtual model has update, insert and delete SQL defined, you can easily provide CRUD capabilities via REST. Accepted inputs into the generated REST operations are URI path parameters and/or XML/JSON. JSON is exposed over a URI that includes "json". For example, "http://{host}:{port}/{war_context}/{model_name}/resource" will accept URI path parameters and/or XML while "http://{host}:{port}/{war_context}/{model_name}/json/resource" will accept URI path parameters and/or JSON.