Testing the Hibernate ODA user interface plug-in
To test the Hibernate ODA user interface plug-in, after exporting it, use a run‑time configuration of the Eclipse PDE Workbench.
How to launch the Hibernate ODA user interface plug-in
1 From the Eclipse SDK menu, choose RunRun Configurations. In Run Configurations, right-click Eclipse Application. Choose New.
2 Create a configuration to launch an Eclipse application.
1 In Name, type:
Hibernate ODA Test
2 In Main, in Location, type:
Run Configurations appears as shown in Figure 25‑24.
Figure 25‑24 Creating a configuration to launch an Eclipse application
3 Choose the Arguments tab. Ensure the following arguments are entered:
*Program arguments:
-os ${target.os} -ws ${target.ws} -arch ${target.arch}
-nl ${target.nl} -consoleLog
*VM arguments:
-Dosgi.requiredJavaVersion=1.6 -Xms40m -Xmx512m
4 Add the Hibernate ODA plug-ins to the launch configuration.
1 In Run Configurations, choose the Plug-ins tab.
2 In Launch with, from the drop-down list, select:
plug-ins selected below only
3 In Plug-ins, check the following plug-ins:
5 Choose Run to launch the run-time workbench.
How to specify a data source and data set
1 In the run-time workbench, choose the Report Design perspective.
2 In Report Design, create a new report project and a new blank report.
3 In Report Design, choose DataNew Data Source. In New Data Source, choose Create from a data source type in the following list, and select Hibernate Data Source as the data source type, as shown in Figure 25‑25. Choose Next.
Figure 25‑25 Selecting Hibernate Data Source
Hibernate Data Source appears.
4 In Hibernate Data Source, select the Hibernate configuration file and mapping directory or leave these items blank if you use the hibfiles directory, as shown in Figure 25‑26. Choose Finish.
Figure 25‑26 Configuring the Hibernate data source
Data Explorer displays the new data source in Data Sources.
5 In Report Design, choose DataNew Data SetNew Data Set. New Data Set appears, as shown in Figure 25‑27.
Figure 25‑27 New Data Set
Choose Next. Hibernate Data Set appears.
6 In Edit Data Set, perform the following tasks:
1 In Enter HQL and verify query, type:
select ord.orderNumber, cus.customerNumber, cus.customerName
from Orders as ord, Customer as cus
where ord.customerNumber = cus.customerNumber
and cus.customerNumber = 363
Edit Data Set displays the query, as shown in Figure 25‑28.
Figure 25‑28 Editing the HQL query
2 Choose Verify Query.
3 Choose Finish. Edit Data Set appears.
4 Choose Preview Results. Preview Results appears as shown in Figure 25‑29.
Figure 25‑29 Previewing the data set
Choose OK.
7 In Data Explorer, expand Data Sets and Data Set. The new data set lists three columns, as shown in Figure 25‑30.
Figure 25‑30 Data Set in Data Explorer
8 To build a report that uses the data set, perform the following tasks:
1 In Data Explorer, drag Data Set to the layout editor. The layout appears, as shown in Figure 25‑31.
Figure 25‑31 Report design in the layout editor
2 To view the output for the report design, choose RunView Report
In Web Viewer. The report appears, as shown in Figure 25‑32.
Figure 25‑32 Preview of the report design