How to add classes to the XBRL Database model

From XBRLWiki
Revision as of 17:36, 4 September 2013 by Ihr (talk | contribs) (Created page with '==Introduction== The User Data Model is a set of Hibernate Entities defined outside the Reporting Standard XBRL and Database API that extends the data model in order to let the u…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

The User Data Model is a set of Hibernate Entities defined outside the Reporting Standard XBRL and Database API that extends the data model in order to let the user add functionality that is not included in the original data model.

For example, the XBRL Database model contains XBRL Concept definitions in one table and XBRL Facts reported in instance documents defined in another table. If the user is interested in the average of all reported values for a specific concept definition there are two approaches: One is to query facts reported for a specific concept definition and then calculate the average value using a database formula, the other is to have that value already calculated and updated every time a new report is stored into the database and query directly that value.

The first approach (the dynamic approach) is good if the amount of information is low and there will be no high demand from the application perspective to execute a big amount of such queries. The second approach is much faster than the first one, but requires additional tables to store the accumulated value and the number of times the value has been reported.

The first approach does not require additional user defined classes. The second approach does.

Defining the user model

The user model is defined by providing two pieces of information. One piece is the class representing the content of a table record. The second piece of information is a file describing the "Serialization" strategy for that class. The first one we call the POJO class (Pure Old Java Object) and the second one is an .hbm.xml file according with Hibernate mapping definition language.

For more information visit http://www.hibernate.org/

How the POJO and the mapping file are loaded

While creating an instance of the StorageService direct link, the first parameter is an array of classes implementing the com.ihr.xbrl.manage.RegisterExtraClasses interface.