Configuring Domains

For advanced uses of Domains, there are some configurations you may consider:

Disabling the Domain Validation Check
Optimizing Snowflake Schema Joins

When you use Domains with certain specific database constructs, you may need to configure JasperReports Server:

Enabling Oracle Synonyms
Enabling CLOB Fields
Enabling Proprietary Types

Disabling the Domain Validation Check

By default, JasperReports Server validates a Domain against its data source to ensure that the Domain design maps properly to the underlying tables. This validation occurs when a Domain design file is uploaded to the server. If your data source is very large and complex, this validation can be time consuming. If the validation takes too long, you can disable it. In this case, JasperReports Server assumes the Domain design is valid, and simply uploads it without the check. You can disable the validation by editing the following configuration file:

Configuring Domain Validation Check

Configuration File

…\WEB-INF\applicationContext-semanticLayer.xml

Property

Bean

Description

skipDomainDatabase
Validation

slConfig

By default, this property is set to FALSE; in this case, JasperReports Server validates Domain designs against their data sources. Set it to TRUE to disable this validation check.

If the tables and fields referenced in the Domain design don’t exist in the data source when skipDomainDatabaseValidation is set to TRUE, the Domain wizard won’t detect the problem, but the Choose Data wizard returns errors when your end users work use the Domain.

Optimizing Snowflake Schema Joins

When creating a Domain on top of a snowflake schema, the default joins generated when using the Domain in the Ad Hoc editor may take a long time and include dimensions that are not used in the report. For example, a schema with over a hundred dimension tables mostly connected to a subset of 5-10 fact tables may cause such behavior. The following setting can be enabled to optimize the joins generated for such a snowflake database schema. The default setting has better performance in the more common cases with less tables.

Configuring Domain Join Optimization

Configuration File

…\WEB-INF\applicationContext-semanticLayer.xml

Property

Bean

Description

specialOptimizationOn

graph
Operations

The default setting of false handles typical cases of Domains based on 10-100 tables. For snowflake schemas that typically have 100 or more tables, or for database topologies that cause slow join performance in Ad Hoc views, set this property to true to optimize the joins in the Ad Hoc editor.

Enabling Oracle Synonyms

By default, Domains cannot access synonyms in an Oracle database. Set the following property to enable them. If you access your Oracle database through JNDI, you also need to configure the JNDI connection.

Be aware that the Oracle metadata service works significantly slower when synonyms are in scope.

Enabling Oracle Synonyms

Configuration File

…\WEB-INF\applicationContext-semanticLayer.xml

Property

Bean

Description

includeSynonyms
ForOracle

jdbcMeta
Configuration

Set the value to true:

<value>true</value>

Configuration File

...\META-INF\context.xml

Property

Bean

Description

accessToUnderlying
ConnectionAllowed

<Resourcename=
"jdbc/oracle"...

If you use JNDI, add the following property:

accessToUnderlying
ConnectionAllowed="true"

Enabling CLOB Fields

Support for CLOB (Character Large Object) fields is dependent on your database and must be enabled manually. If you want to access CLOB fields in JasperReports Server, you must set the following options according to your database.

The Oracle JDBC driver implementation uses the CLOB JDBC type for CLOB fields.

CLOB Support for Oracle

Configuration File

…\WEB-INF\applicationContext-semanticLayer.xml

Property

Bean

Description

jdbc2JavaType
Mapping

jdbcMeta
Configuration

This property contains a map of database field types to Java types. Find the line for CLOB that is commented out:

<!--entry key="CLOB" value=""/-->

Modify it as follows:

<entry key="CLOB" value="java.lang.String"/>

The MySQL JDBC driver implementation uses either the CLOB JDBC type, the LONGVARBINARY JDBC type, or both to represent CLOB fields, depending on their length.

CLOB Support for MySQL

Configuration File

…\WEB-INF\applicationContext-semanticLayer.xml

Property

Bean

Description

jdbc2JavaType
Mapping

jdbcMeta
Configuration

This property contains a map of database field types to Java types. Find the following lines:

<!--entry key="CLOB" value=""/-->
<!--entry key="LONGVARBINARY" value=""/-->

And modify them as follows:

<entry key="CLOB" value="java.lang.String"/>
<entry key="LONGVARBINARY" value="java.lang.String"/>

Enabling Proprietary Types

JasperReports Server provides a JDBC-to-Java type mapping for all standard JDBC column types for use in Domains. However, some databases have proprietary types, such as NVARCHAR2 in Oracle. You can map these types with a special configuration.

As a prerequisite, the proprietary type must be logically equivalent to one of following Java classes:

java.lang.Boolean

java.lang.Byte

java.lang.Character

java.lang.Double

java.lang.Float

java.lang.Integer

java.lang.Long

java.lang.Short

java.lang.String

java.math.BigDecimal

java.sql.Date

java.sql.Time

java.sql.Timestamp

java.util.Date

There are two ways to create a mapping for a proprietary type, as shown in the following table:

Modify the generic mapping for NUMERIC types. By default, any numeric type that doesn’t match one of the other types is mapped to BigDecimal.
Create a secondary mapping under the special OTHER key, where the secondary key can be your custom type name.

Proprietary Database Type Mapping

Configuration File

…\WEB-INF\applicationContext-semanticLayer.xml

Properties

Bean

Description

jdbc2JavaType
Mapping

jdbcMeta
Configuration

To modify the generic mapping, edit this line:
<entry key="NUMERIC" value="java.math.BigDecimal"/>
Add any secondary key to the OTHER key, following this example:
<entry key="OTHER">
    <map>
        <entry key="NVARCHAR2" value="java.lang.String"/>
    </map>
</entry>
Java 1.6 supports java.sql.Types.NVARCHAR, therefore you should add it as a generic mapping, not under OTHER:
<entry key="NVARCHAR" value="java.lang.String"/>
Version: 
Feedback