SqlMapper is a tool that generates source code based on annotated SQL table definitions.
SqlMapper is not intended to be a full ORM/DAO solution, but just a way to centralize and automate your data definitions. It is meant to be used as a 'preprocessor' in conjunction with an ORM/DAO package such as Persist.
There are many ORM/DAO packages to relieve developers from writing the repetitive code for storing and retrieving data from a database. This is great, but most of these packages still require you to define your data structures in more than one place. For example, you may initially define your database tables in a SQL file, and then have to write separate configuration or mapping files defining how the tables map to your model objects. Or you have to write your model classes and make sure that they map to the tables in your schema. Some packages try to use the database metadata to avoid this duplication but the metadata support varies from one database to another making this a fragile solution.
SqlMapper attempts to address these problems by allowing you to define your object models at the same time and in the same place that you define your database schema. You do this by adding annotation comments to your database table and column definitions. SqlMapper then reads this annotated SQL schema file along with one or more template files, and it outputs a source code file for each database table definition.
More documentation can be found here.
Comments