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

qbenewhibconf3.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'.
qbeNewHibConfWizard.bmp

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

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

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

  • Create a new configuration for the code generation task
QbeCreateNewCodGenConf.bmp

  • 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
QbeCodeGenConf1.bmp

  • 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'
QbeCodeGenConf2.bmp

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

  • 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
QbeGeneratedCode.bmp

2 Hibernate mapping adjustement

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

QbeLabels.bmp

  • If you need to localize labels and tooltips associated to each item in your datamart structure create a label_loacle.properties for each locale you need to support (ex. label_it.properties, label_en.properties, label_fr.properties, ecc ...)
QbeLocalizedLabels.bmp

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

3 jar production for datamart representation

  • Export the project as a jar file (menu File->Export...->Java->Jar) named datamart.jar
QbeExport.bmp
Tags:
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