About

SQL DAL Maker generates the data access layer — DTO, Model, and DAO classes — for PHP, Java, C++, Python, and Go.

It works like this:

  1. XML manifest. The manifest describes what to generate: the DTO and model classes, the DAO methods, and the SQL behind them.
  2. Translate. The manifest is translated into complete source code — free of any direct call to PDO, JDBC, or QtSql. Those stay behind a DataStore interface that you own.

Reverse engineering serves both. It can write a first draft of the manifest, so you rarely start from an empty file — but the manifest is an ordinary text file and can just as well be written by hand. And it runs again during translation: the generator reads live metadata over JDBC — tables, views, and the result sets of your own SQL — to resolve everything the manifest leaves open. That is why the database must be up and reachable whenever you generate.

The manifest persists, so regeneration is repeatable: when the schema changes, you re-run the generator and your corrections are still there.

Implemented in Java as plug-ins for Eclipse IDE and IntelliJ Platform.

Hello-App
<sdm>
    <dto-class name="Message" ref="messages"/>
    <dao-class name="MessagesDao">
        <crud dto="Message"/>
        <query-list method="get_messages_like(key)" ref="get_messages_like.sql"/>
    </dao-class>
</sdm>
def generated_code_in_action():
    ds = scoped_ds()
    dao = MessagesDao(ds)
    m = Message()
    m.text = "Hello, World!"
    dao.create_message(m)
    print(m.id) # new "id" is available now
    m.text = "Hello, SDM World!"
    dao.update_message(m)
    for msg in dao.get_messages_like("hello%"):
        print(msg)
    dao.delete_message(m.id)
Install and Update
Eclipse IDE 3.8+

Follow this: https://marketplace.eclipse.org/content/sql-dal-maker/help or use drag-and-drop feature from here: https://marketplace.eclipse.org/content/sql-dal-maker

Update site URL 1 (fast access): https://sourceforge.net/projects/sqldalmaker/files/eclipse

Update site URL 2 (redirected): https://sqldalmaker.sourceforge.net/eclipse

IntelliJ Platform 222.3345.118+

Supported products: PhpStorm, IntelliJ IDEA, Android Studio, CLion, PyCharm, GoLand.

IDE Menu "File" > Settings > Plugins > Marketplace > SQL DAL Maker > Install.

IDE Menu "File" > Settings > Plugins > Installed > SQL DAL Maker > Update.

Or use "Install..." button from the plug-in web-page: http://plugins.jetbrains.com/plugin/7092

Links
Quick Demo in mp4
The Plugin on GitHub