Empire-db's key strength is its API for dynamic SQL generation for arbitrary select, update, insert or delete statements, purely by using Java methods which reference the model objects. This provides type-safety and almost entirely eliminates the use of string literals for names or expressions in code. Additionally DBMS independence is achieved through a pluggable driver model.
Using references to table and column objects significantly improves compile-time safety and thus reduces the amount of testing. As a positive side effect the IDE's code completion can be used to browse the data model, increases productivity and eliminates the need for other external tools or IDE-plugins.
Further the object model also provides safe and easy access to meta-information of the data model such as field data type, maximum field length, whether a field is mandatory and a finite choice of options for a field's values. Metadata is user-extensible and not limited to DBMS related metadata. Availability of meta-information encourages more generic code and eliminates redundancies throughout application layers.
As an example consider a database with two tables called Employees and Departments for which a list of employees in a particular format, with certain constraints and a given order should be retrieved.
The corresponding Oracle syntax SQL statement is assumed to be as follows:
This SQL statement can be created using Empire-db's command API using object model references like this:
In order to execute the query and retrieve a list of POJO's holding the query result the following code may be used:
Empire-db also supports field access through object references or obtaining query results as XML.
Empire-db was originally developed at ESTEAM Software a German software development company which used Empire-db to develop various applications for a variety of different branches.
In January 2008 Empire-db was made officially open source and first published though SourceForge.net.
In June 2008 a proposal was submitted to the Apache Software Foundation for Empire-db to become an Apache Incubator project. In July 2008 Empire-db got accepted for incubation and all rights over the Software were transferred to the Apache Foundation.
In October 2008 Empire-db 2.0.4 was the first official Apache incubator release with all package names changed to begin with org.apache.empire.
"Apache Empire-db". empire-db.apache.org. Retrieved 2022-03-21. https://empire-db.apache.org/pages/home.html ↩