spagobi_server_create+the+datamart

19
Create Datamart Angelo Bernabei 2011/02/10 10:41

Upload: daniel-gheller

Post on 17-Jul-2016

14 views

Category:

Documents


3 download

DESCRIPTION

spagobi_server_Create+the+datamart

TRANSCRIPT

Page 1: spagobi_server_Create+the+datamart

Create DatamartAngelo Bernabei2011/02/10 10:41

Page 2: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 2 - last modified by Angelo Bernabei on 2011/02/10 10:41

Table of ContentsCreate Datamart ......................................................................................................................................................................... 3

1 Reverse engineering the target database schema ................................................................................................................ 32 Hibernate mapping adjustement ........................................................................................................................................ 163 jar production for datamart representation ........................................................................................................................ 18

Page 3: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 3 - last modified by Angelo Bernabei on 2011/02/10 10:41

Create Datamart

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

• 1 Reverse engineering the target database schema• 2 Hibernate mapping adjustement• 3 jar production for datamart representation

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 alreadyinstalled. Hibernate Tools can be downloaded here . Once you have installed succesfully the pluging in your Eclipse IDEyou can follow these steps in order to reverse engineering your database schema...

• Start Eclipse and create a new Java Project

Page 4: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 4 - last modified by Angelo Bernabei on 2011/02/10 10:41

Page 5: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 5 - last modified by Angelo Bernabei on 2011/02/10 10:41

• Create a new Hibernate Configuration file under src folder(File Menu -> New ->#Other then Hibernate -> Hibernateconfiguration file)

Page 6: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 6 - last modified by Angelo Bernabei on 2011/02/10 10:41

Page 7: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 7 - last modified by Angelo Bernabei on 2011/02/10 10:41

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

Page 8: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 8 - last modified by Angelo Bernabei on 2011/02/10 10:41

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

Page 9: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 9 - last modified by Angelo Bernabei on 2011/02/10 10:41

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

Page 10: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 10 - last modified by Angelo Bernabei on 2011/02/10 10:41

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

Page 11: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 11 - last modified by Angelo Bernabei on 2011/02/10 10:41

• Create a new configuration for the code generation task

Page 12: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 12 - last modified by Angelo Bernabei on 2011/02/10 10:41

• 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

Page 13: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 13 - last modified by Angelo Bernabei on 2011/02/10 10:41

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

Page 14: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 14 - last modified by Angelo Bernabei on 2011/02/10 10:41

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

Page 15: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 15 - last modified by Angelo Bernabei on 2011/02/10 10:41

• 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

Page 16: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 16 - last modified by Angelo Bernabei on 2011/02/10 10:41

2 Hibernate mapping adjustement

• If you want to customize labels and tooltips associated to each item in your datamart structure you create alabel.properties file in the root of your java project

Page 17: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 17 - last modified by Angelo Bernabei on 2011/02/10 10:41

TIPS: under SpagoBIQbeEngine web application you can find label.properties file, you can use this to create yourscustom file

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

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

Page 18: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 18 - last modified by Angelo Bernabei on 2011/02/10 10:41

3 jar production for datamart representation

• Export the project as a jar file (menu File->Export...->Java->Jar) named datamart.jar

Page 19: spagobi_server_Create+the+datamart

spagobi_server - Create Datamart

Page 19 - last modified by Angelo Bernabei on 2011/02/10 10:41