Data from a Sparx Enterprise Architect modelling project is stored in a database. When one works on a local Sparx EA project, the file used has an EAP extension and is effectively a Jet Engine database that can be opened with Ms Access.
Sparx reverse engineering features on relational databases can be run on an Enterprise Architect project to extract its schema definition such as tables, columns and relations managed by Sparx modelling tool.
This article provides a procedure to achieve this using Enterprise Architect 12.1 built-in DB Builder tool.
- Create a copy of your local EA project file and rename its eap extension to mdb.
- Open Enterprise Architect and create the target project where the reverse engineering will be run.
- Configure an ODBC Ms Access DSN:
- Open the menu Tools > ODBC Data Sources
- Add a user data source
- Select Microsoft Access Driver (this driver should be available if Access has been installed. If not, try the following link: https://www.microsoft.com/en-US/download/details.aspx?id=13255).
- Provide a title and select the MDB file defined earlier on.
- Having the ODBC user data source available, open the EA menu Tools > Database Builder in the target EA project.
- Create a new data model (right click > New Data Model).
- Select Data Model – MSAccess from the list.
- A "DataModel" stereotyped package has been created within the selected package with a predefined tree where tables, queries and views will be stored for each database.
- Right click on the data model > Load.
- Set up a new connection to the ODBC data source that matches the MDB file (right click on Connections > Add new DB connection).
- Double click on the connection and select ODBC based database.
- Open the System data source tab and select the entry created earlier on.
- Right click on the new connection > Set as Active DB Connection.
- Right click data model root > Import DB schema from ODBC.
- Change any option if needed and click on Import.
- Select all tables and views.
- Tables and views have been imported in the Data Model including column details, primary keys, foreign keys, indexes, relations, etc.
- Selecting a table from the screen below provides access to its columns list.
- Note: Sparx EA DB Builder tool provides a dedicated user interface to work on data models. It uses features that have been available for a long time in Sparx Enterprise Architect modelling tool. The DB Builder automatically manages a suitable package tree structure where all the information such as tables is stored and updated accordingly. As a result one can work in a more efficient manner compared with accessing tables properties windows.
- The following Project Browser view illustrates the list of imported tables from a Sparx EA project;
- Imported views include details on the tables used and the associated SQL query: