iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library

13.07.2015 Views

iReport Ultimate GuideFigure 11-31 Spring-based Hibernate connectionNow that a Hibernate connection is available, use an HQL query to select the data to print. You can use HQL in the same waythat you use SQL: open the Report query dialog box and choose HQL as the query language from the combo box at the top ofthe window (see Figure 11-32).200

Data Sources and Query ExecutersFigure 11-32 The HQL and the HQL mapping toolWhen you enter an HQL query, iReport tries to retrieve the available fields. According to the UR documentation,the field mappings are resolved as follows:• If the query returns one object per row, a field mapping can be one of the following:• If the object’s type is a Hibernate entity or component type, the field mappings are resolved as the property names ofthe entity/component. If a select alias is present, it can be used to map a field to the whole entity/component object.• Otherwise, the object type is considered scalar, and only one field can be mapped to its value.• If the query returns a tuple (object array) per row, a field mapping can be one of the following:• A select alias. The field will be mapped to the value corresponding to the alias.• A property name prefixed by a select alias and a “.”. The field will be mapped to the value of the property for theobject corresponding to the alias. The type corresponding to the select alias has to be an entity or component.If you don’t understand this field mapping information, simply accept the fields listed by iReport when the query isparsed.iReport provides a mapping tool to map objects and attributes to report fields. The objects (or JavaBeans) available in eachrecord are listed in the combo box on top of the object tree.To add a field from the tree, select the corresponding node and click the Add selected field(s) button.11.6.10 Using a Hadoop Hive ConnectionUR provides a way to use Hive in your reports. Unlike traditional databases, Hadoop systems support huge amountsof data, generally called big data. But this capability has a cost: high latency with access times between 30 seconds and 2minutes.Because of the latency, reports based on Hadoop-Hive data sources are best suited to be run in the background or tobe scheduled. For example, the report could be run at 6 a.m. and the HTML or PDF could be exported and stored foranyone wanting to access the report during the day.201

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>Figure 11-31 Spring-based Hibernate connectionNow that a Hibernate connection is available, use an HQL query to select the data to print. You can use HQL in the same waythat you use SQL: open the Report query dialog box and choose HQL as the query language from the combo box at the top ofthe window (see Figure 11-32).200

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!