Using the Enterprise Data Mashup Service Engine
Configuring Data Mashup Projects Using Joins
After creating a virtual database, Data Mashup project, and EDM collaboration, you are ready to bring all your diverse data into a common staging area and create a federated view of the data. This topic provides the necessary steps for you to create data joins using the data stored in the staging tables.
Perform the following steps to create and configure a join:
To Add the Tables to the EDM Collaboration
Before You Begin
Before creating a join, you must have a virtual database, Data Mashup project, the NetBeans IDE must be running, and you must be connected to the virtual database.
- If necessary, connect to the virtual database.
- In the NetBeans IDE, click the Services tab and expand Databases.
- Right-click the database you want to start and select Connect.
In this procedure, start VirtualMashupDB.
- In the NetBeans IDE Project window, expand the Data Mashup project.
- Under Collaborations, double-click the EDM collaboration (demoDMfile.edm for this exercise).
The file opens in the EDM Editor canvas.
- Right-click in the EDM Editor canvas and select Add Table.
- In the Select Source Table window, select the virtual database you created earlier (VirtualMashupDB).
The tables in the database appear under Schema.
- Highlight the SUPPLIER_ADDRESS and COMPANY_DATA tables and click Select.
- Click OK.
The window closes and the tables, along with Runtime Input, appear on the canvas. You are now ready to create the join.
To Create the Join
This step merges the SUPPLIER_ADDRESS and COMPANY_DATA into one table.
- From the Table Operators palette, drag the Join operator onto the canvas.
- In the Create New Join View window, click All to move both tables to the Selected Tables list.
Both tables appear in the Preview area and are linked to the join.
- To edit the type of join, click in the field at the top of the join table and select one of the following options:
- Inner - Returns only the records in the selected tables that match. For this exercise, use this option.
- Left Outer - Returns all records in the left table regardless if there are any matches with the right table. When there are no matches, the field is NULL.
- Right Outer - Returns all records in the right table regardless if there are any matches with the left table. When there are no matches, the field is NULL.
- Full Outer - Returns the all records from the left and right tables in the merged table. All fields that do not match are NULL.
- Click OK.
The root join is added to the canvas and is linked to the two tables. You can now create join conditions for the tables.
To Create a Join Condition
Once you create a join, so you can edit it as necessary by creating join conditions.
- Open the EDM collaboration file in the EDM Editor.
- Right-click the Root Join table on the canvas and then click Edit Join Condition.
The Edit Join Condition window, also called the Condition Builder, appears.
- Drag a column from the first table onto the empty canvas on the right.
For this exercise, drag VENDOR from the CUSTOMER_DATA table.
- Drag and drop a comparison, string, or another operator onto the canvas to the right of the column name.
For this exercise, use the equal (=) sign.
Tip - To add an operator, click the appropriate icon on the toolbar. When the drop-down menu appears, click the icon you want to use and drag it onto the canvas.
- Drag a column from the second table onto the canvas to the right of the operator.
For this exercise, drag the VENDOR column from the SUPPLIER_ADDRESS table.
- Click OK.
The Edit Join Condition window closes.
- Click Save All.
You are now ready to build the Data Mashup project.
To Complete the Data Mashup Project
Once the Data Mashup project is configured and saved, you need to build the project in order to create the WSDL document. This document is automatically generated based on the configuration of the collaboration.
- To complete the project, right-click the project name and select Build Project.
A WSDL document named ProjectName_CollaborationName_engine.wsdl is created under the Collaboration node . In this exercise, the file is named DemoDMProject_demoDMfile_engine.wsdl.
You are now ready to create and deploy a composite application in the Sun GlassFish Enterprise Server. For instructions on how to perform this task, see Creating and Deploying a Composite Application for a Data Mashup Project.
Return to GlassFish ESB Documentation Home