Creating the Hibernate ODA driver plug-in project
Create the Hibernate ODA driver plug-in project, org.eclipse.birt.report.data
.oda.hibernate, using the New Plug-in Project wizard in the Eclipse PDE.
How to create the Hibernate ODA driver plug-in project
1 From the Eclipse PDE menu, choose FileNewProject.
2 In New Project—Select a wizard, open Business Intelligence and Reporting Tools and select ODA Runtime Driver Plug-in Project. Choose Next. New Plug-in Project appears.
3 In Plug-in Project, apply the settings shown in Table 25‑8. Choose Next.
Table 25‑8 Settings for the Hibernate ODA plug-in project
options
Section
Option
Value
Plug-in Project
Project name
org.eclipse.birt.report.data
.oda.hibernate
 
Use default location
Selected
 
Location
Not available when you select Use default location
Project Settings
Create a Java project
Selected
 
Source folder name
src
 
Output folder name
bin
Target Platform
Eclipse version
3.5 or greater
 
OSGi framework
Deselected
Working Sets
Add project to working sets
Not selected
4 On Plug-in Content, modify the settings as shown in Table 25‑9.
Table 25‑9 Settings for the Hibernate ODA plug-in content options
Section
Option
Value
Properties
ID
org.eclipse.birt.report.data
.oda.hibernate
 
Version
2.0.0
 
Name
BIRT ODA-Hibernate Driver
 
Vendor
yourCompany.com or leave blank
 
Execution Environment
JavaSE-1.7
Options
Generate an activator, a Java class that controls the plug-in’s life cycle
Selected
 
Activator
org.eclipse.birt.report.data
.oda.hibernate.Activator
 
This plug-in will make contributions to the UI
Deselected
 
Enable API Analysis
Deselected
Rich Client Application
Would you like to create a 3.x rich client application?
No
Choose Next.
5 In Templates, choose ODA Data Source Runtime Driver. Choose Next.
6 In ODA Data Source Runtime Driver, specify values for the following options used to generate the ODA plug-in, as shown in Table 25‑10.
Table 25‑10 Settings for the ODA data source run‑time driver options
Option
Value
Java Package Name
org.eclipse.birt.report.data.oda.hibernate
ODA Data Source Element Id
org.eclipse.birt.report.data.oda.hibernate
Data Source Display Name
Hibernate Data Source
Number of Data Source Properties
2
Data Set Display Name
Hibernate Data Set
Number of Data Set Properties
0
Choose Finish. After a few moments of processing, the Hibernate ODA driver plug-in project appears in the Eclipse PDE Workbench.
How to specify the properties of the Hibernate ODA plug-in project
1 Using the Eclipse PDE Manifest Editor, in Dependencies, specify the following required plug-ins in the following order:
*org.eclipse.core.runtime
*org.eclipse.datatools.connectivity.oda
*org.eclipse.birt.report.data.oda.jdbc
2 On Runtime, in Classpath, add the following JAR files to the plug-in classpath:
*odahibernate.jar
*lib/commons-collections-2.1.1.jar
*lib/ant-antlr-1.6.5.jar
*lib/commons-logging-1.0.4.jar
*lib/antlr-2.7.6rc1.jar
*lib/dom4j-1.6.1.jar
*lib/asm.jar
*lib/ehcache-1.1.jar
*lib/asm-attrs.jar
*lib/hibernate3.jar
*lib/cglib-2.1.3.jar
*lib/jta.jar
These JAR files must have been previously imported into the lib directory in the Hibernate ODA plug‑in. These JAR files can also be put in a new plug-in that the Hibernate ODA plug-in references.
3 In Runtime, in Exported Packages, use Add and verify that the following packages that the plug-in exposes to clients appear in the list:
*antlr
*org.hibernate.connection
*antlr.actions.cpp
*org.hibernate.context
*antlr.actions.csharp
*org.hibernate.criterion
*antlr.actions.java
*org.hibernate.dialect
*antlr.actions.python
*org.hibernate.dialect.function
*antlr.ASdebug
*org.hibernate.engine
*antlr.build
*org.hibernate.engine.query
*antlr.collections
*org.hibernate.engine.transaction
*antlr.collections.impl
*org.hibernate.event
*antlr.debug
*org.hibernate.event.def
*antlr.debug.misc
*org.hibernate.exception
*antlr.preprocessor
*org.hibernate.hql
*javax.transaction
*org.hibernate.hql.antlr
*javax.transaction.xa
*org.hibernate.hql.ast
*net.sf.cglib.beans
*org.hibernate.hql.ast.exec
*net.sf.cglib.core
*org.hibernate.hql.ast.tree
*net.sf.cglib.proxy
*org.hibernate.hql.ast.util
*net.sf.cglib.reflect
*org.hibernate.hql.classic
*net.sf.cglib.transform
*org.hibernate.id
*net.sf.cglib.transform.hook
*org.hibernate.impl
*net.sf.cglib.transform.impl
*org.hibernate.intercept
*net.sf.cglib.util
*org.hibernate.jdbc
*net.sf.ehcache
*org.hibernate.jmx
*net.sf.ehcache.config
*org.hibernate.loader
*net.sf.ehcache.hibernate
*org.hibernate.loader.collection
*net.sf.ehcache.store
*org.hibernate.loader.criteria
*org.apache.commons.collections
*org.hibernate.loader.custom
*org.apache.commons.collections
.comparators
*org.hibernate.loader.entity
*org.apache.commons.collections
.iterators
*org.hibernate.loader.hql
*org.apache.commons.logging
*org.hibernate.lob
*org.apache.commons.logging.impl
*org.hibernate.mapping
*org.apache.tools.ant.taskdefs
.optional
*org.hibernate.metadata
*org.dom4j
*org.hibernate.param
*org.dom4j.bean
*org.hibernate.persister
*org.dom4j.datatype
*org.hibernate.persister.collection
*org.dom4j.dom
*org.hibernate.persister.entity
*org.dom4j.dtd
*org.hibernate.pretty
*org.dom4j.io
*org.hibernate.property
*org.dom4j.jaxb
*org.hibernate.proxy
*org.dom4j.rule
*org.hibernate.secure
*org.dom4j.rule.pattern
*org.hibernate.sql
*org.dom4j.swing
*org.hibernate.stat
*org.dom4j.tree
*org.hibernate.tool.hbm2ddl
*org.dom4j.util
*org.hibernate.tool.instrument
*org.dom4j.xpath
*org.hibernate.transaction
*org.dom4j.xpp
*org.hibernate.transform
*org.hibernate
*org.hibernate.tuple
*org.hibernate.action
*org.hibernate.type
*org.hibernate.cache
*org.hibernate.usertype
*org.hibernate.cache.entry
*org.hibernate.util
*org.hibernate.cfg
*org.objectweb.asm
*org.hibernate.classic
*org.objectweb.asm.attrs
*org.hibernate.collection
 
4 On Extensions, add the extension point, org.eclipse.datatools.connectivity
.oda.dataSource, and the following elements and details for:
*dataSource
Add the extension element details, as shown in Table 25‑11.
Table 25‑11 Property settings for the Hibernate dataSource extension element
Property
Value
id
org.eclipse.birt.report.data.oda
.hibernate
driverClass
org.eclipse.birt.report.data.oda
.hibernate.HibernateDriver
odaVersion
3.2
defaultDisplayName
Hibernate Data Source
setThreadContextClassLoader
true
overrideExplorerFiltering
 
The dataSource extension has an attribute named setThreadContextClassLoader, which, if set to true, sets the thread context class loader to the Hibernate ODA plug-in class loader. In this example, this attribute is set to true to avoid potential class conflicts with classes loaded with the Eclipse Tomcat plug-in.
*dataSet
Add the extension element details, as shown in Table 25‑12.
Table 25‑12 Property settings for the Hibernate dataSet extension
element
Property
Value
id
org.eclipse.birt.report.data.oda
.hibernate.dataSet
defaultDisplayName
Hibernate Data Set
5 In Extensions, select dataSource and add the following properties and element details, setting all other details to blank:
*HIBCONFIG, as shown in Table 25‑13
Table 25‑13 HIBCONFIG property settings
Property
Value
name
HIBCONFIG
defaultDisplayName
Hibernate Configuration File
type
string
canInherit
true
*MAPDIR, as shown in Table 25‑14
Table 25‑14 MAPDIR property settings
Property
Value
name
MAPDIR
defaultDisplayName
Hibernate Mapping Directory
type
string
canInherit
true
6 In Extensions, select dataSet and add the list of dataTypeMapping elements, as shown in Table 25‑15.
Table 25‑15 Settings for Hibernate dataTypeMapping elements
nativeDataTypeCode
nativeDataType
odaScalarDataType
-5
BIGINT
Decimal
-2
BINARY
String
-7
BIT
Integer
2004
BLOB
Blob
16
BOOLEAN
Integer
1
CHAR
String
2005
CLOB
Clob
91
DATE
Date
3
DECIMAL
Decimal
8
DOUBLE
Double
6
FLOAT
Double
4
INTEGER
Integer
-4
LONGVARBINARY
String
-1
LONGVARCHAR
String
2
NUMERIC
Decimal
7
REAL
Double
5
SMALLINT
Integer
92
TIME
Time
93
TIMESTAMP
Timestamp
-6
TINYINT
Integer
-3
VARBINARY
String
12
VARCHAR
String