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 File➛New➛Project.
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
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
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