Data Dictionary
|
The data dictionary maps Java persistent objects onto the corresponding RDBMS tables. Originally this was done through information held in the RDBMS itself. From version 1.10 the preferred method is to create an .XML format file. XML Format Data DictionaryRDBMS Data DictionaryA class is mapped onto a single instance of an RDBMS table. The data dictionary comprises 3 tables held in the primary database. Data_Dictionary table
Database table
Class_Dictionary table
Data Dictionary bootstrapThe data dictionary is stored in relational database tables accessible using JDBC. These may be part of the main database or on an entirely separate database or RDBMS. In order to initialise the data dictionary a bootstrap properties file must be defined, this is called connection.properties and contains the following variables:- driver=JDBC driver name An example would be:- driver=postgresql.Driver| Priming the data dictionaryThe databases table must be primed with entries for the database containing the data dictionary and for any additional databases. The data dictionary is held in a database called primary, this is shared with the applications tables. INSERT INTO databases VALUES (‘primary’, ‘ postgresql.Driver’, ‘jdbc:postgresql://sun2.kimble.co.uk:5432/orderdb’, ‘ zardoz’, ‘wizard’, -1, ‘postgres-3.2’); Entries for each persistent object must now be added, for example a Customer table: INSERT INTO data_dictionary VALUES (‘uk.co.kimble.examples.Customer’, ‘primary’, ‘customer’); etc… This states that the customer table is mapped to a Java class called uk.co.kimble.example.Customer, the customer_id attribute is the primary key. For brevity lines can be omitted where the attribute is not a primary key its name is the same as the database column name. In the future it is intended to add two utilities to the COBRA utility suite. A graphic application for visually realizing data schemas and generating data dictionaries and an application to generate a data dictionary for legacy databases. © Kimble Consultancy Services Ltd
|