Essential ORM Modeler allows you to model your application using an extension of UML class models, generating code for distinct ORM frameworks (JPA, SQLAlchemy or Ruby´s ActiveRecord). The notation, called ENORM (Essential Notation for ORM), is based on persistence patterns, and is platform independent.
This tool is a plugin of eclipse.
JPA frameworks such as Hibernate, SQLAlchemy, and Ruby´s activerecord are ORM frameworks from distinct platforms. They follow basically the same persistence patterns well described by Fowler´s Enterprise patterns.
To show our point, lets take an example also from patterns, the Accounting patterns:
The three implementations follows the same database structure. Notice that Ruby´s implementation presents some table with distinct names, following the Ruby´s convention.
The main mappings applied are (and their patterns, when it applies):
- Vertical (or joined) inheritance to implement the Account hierarchy. Class table inheritance pattern.
- Quantity is Embedded at the related classes
- Many-to-Many implemented by act_comps table, association table mapping pattern
- Entry is identified by the pair of number and id_transaction. Dependent Mapping.
- Identity Field and Foreign Key Mapping are used to identify entities and store associations.
- The information about the balance (date, value, unit) of the Account class is stored in another table named Act_Brief. Account table has a one-to-one relation with Act_Bried.
- Unit is stored in a table named Currency.
- Some columns are stored with distinct names in the database, when the framework allows thar (dtBalance is dt_calc for instance).
The goal of this example was to show some advanced mappings, more than just "one class for each table, one property for each column". The full implementation of Account is hosted at sourceforge git´s repository:
The wiki uses Markdown syntax.
By the update site of eclipse:
Go to Help->Install New Software...
At the Work With, click Add.. button and enter:
Select EORM from the Work With list, and EORM at the bottom list, along with the requirements
(DLTK has no update site yet, so we are distributing it along our plugin)