JBoss.orgCommunity Documentation

Chapter 7. Metadata-specific Modeling

7.1. Relational Source Modeling
7.1.1. Source Function
7.1.2. Create Relational Table Wizard
7.2. Relational View Modeling
7.2.1. Create Materialized Views
7.2.2. Create Relational View Table Wizard
7.3. XML Document Modeling
7.3.1. Create XML View Documents from schema
7.4. Web Services Modeling
7.4.1. Create Web Service Action
7.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 replaces the original New Child > Base Table, which only created the empty table.


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 table name, define columns, keys, constraints and other options, then 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

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.


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 D.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.


In Teiid Designer 7.7 a new action, New Child > Base Table..., was added to aid in creating relational view tables, complete with its target columns and SQL transformation. This action replaces the original New Child > Base Table action, which only created the empty table.


Running the action will display the Create Relational View Table wizard. The wizard page contains 3 tabbed panels representing the various properties and components that make up the possible definition of a relational view table. Enter your table name, define the desired columns and specify the SQL transformation, then click OK.

This wizard is designed to provide feedback as to the completeness of the relational view table information, as well as the validation state of the table and it's components.

Note

Although errors or warnings may be displayed during editing, the wizard is designed to allow finishing even if the table definition is incomplete.

The first tab labeled Properties contains the input for the simple table properties including name and supports update.


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 SQL tab allows editing of the SQL Transformation for the relational view. The desired SQL can be entered directly into the text area or a SQL Template may be selected by clicking the Templates... button.


If the Templates... button is selected on the SQL tab, the Choose a SQL Template dialog will display, as shown below.


A number of common SQL templates may be chosen using the dialog. Depending on usage context, the PROCEDURES tab may also be available in addition to the SELECT queries tab. The SQL Template dialog can also be accessed in the Transformation Editor, from the rt-click context menu.

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 4.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.

Once you have deployed your war file, you are ready to test it out. There are a few ways to accomplish this.

SOAP WAR Testing

REST WAR Testing