Create Datamart (SpagoBI 3)

Create Datamart (SpagoBI 3)

The datamart is a data abstraction model built by means of Hibernate Tools. The main steps are:

1 Reverse engineering the target database schema

In order to reverse engineering your target database scheme you need an Eclpise IDE with Hibernate Tools plugin already installed. Hibernate Tools can be downloaded here. Once you have installed succesfully the pluging in your Eclipse IDE you can follow these steps in order to reverse engineering your database schema...

  • Start Eclipse and create a new Java Project
qbenewproject.bmp qbenewprojectwizard.bmp

  • Create a new Hibernate Configuration file under src folder(File Menu -> New ->Other then Hibernate -> Hibernate configuration file)
qbenewhibconf1.bmp qbenewhibconf2.bmp


  • Choose the right dialect for your database and fill all the required fields (driver class, connection string, schema, username and password). Then check 'create console configuration' and press 'Next'.

  • Fill the console name field and in the 'option' tab set the db dialect

  • In the 'classpath' include in the default classpath the proper jdbc driver for your target database than click 'Finish'

  • Select "Hibernate Code Generation Configuration..." from menu Run->Hibernate Code Generation ...

  • Create a new configuration for the code generation task

  • Set the name of the newly created configuration
  • Select as console configuration the hibernate configuration previusly created (demo in this example)
  • Select project's src dir as 'Output directory'
  • Set the package name of the generated code (it.foodmart in this example)
  • Set the field 'reveng.strategy' with the value: org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy

  • If you want to reverse engineering only some tables and not the full schema create a new reveng.xml file. To filter tables click on 'Refresh' button and then wait until the full database schema is shown. At this point is possible to choose which table to include in the code generation process. Once finished click on 'Finish'

  • In the 'Exporters' section check options as follow....

  • Click on the 'Apply' button to save configuration and on the 'Run' button to execut the code generation process
  • Refresh the project (F5) and check out the newly created mappings and objects

2 Hibernate mapping adjustement

  • If you want to customize labels and tooltips associated to each item in your datamart structure you create a file in the root of your java project
TIPS: under SpagoBIQbeEngine web application you can find file, you can use this to create yours custom file


  • If you need to localize labels and tooltips associated to each item in your datamart structure create a for each locale you need to support (ex.,,, ecc ...)

  • Create in the project root folder a file named for changing the visual representation of schema items (visibility, icons, position, ecc ...)

3 jar production for datamart representation

  • Export the project as a jar file (menu File->Export...->Java->Jar) named datamart.jar
Created by angioia on 2009/10/21 16:48
Last modified by Alberto Ghedin on 2015/07/09 14:17

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 2.7.33694 - Documentation