IDE tool-bar button

The plug-in integrates a navigation drop-down button to IDE tool-bar. By selecting drop-down items, you can easily switch between XML meta-programs of your workspace/project.

CRUD-code for all tables in 5 minutes

Step 1. Generate temporary XML-tags for DTO (Tab 'DTO', local tool-bar, button 'Generate temporary DTO...'):

<dto-class name="Product" ref="products" />
<dto-class name="Customer" ref="customers" />
<!-- etc. -->

Step 2. Generate temporary XML-tags for DAO (Tab 'DAO', local tool-bar, button 'Generate temporary DAO...'):

<crud-auto dto="Product" table="products" />
<crud-auto dto="Customer" table="customers" />
<!-- etc. -->

Step 3. Copy-paste temporary XML-tags to XML meta-program. Remove useless tags if needed.

Step 4. Run code generator to obtain data access code.

Automated validation of generated code

In many situations, generated code may become not valid:

  • changed DB-schema
  • changed SQL statement(s)
  • changed connection parameters
  • etc.

Code validation tool provided by the plug-ins allows you to see the whole picture of problems and create a plan of fixes. It is much better than if you perform total code-regeneration and obtain infinite amount of compiler/run-time errors.

Automation of XML coding

By default, IDE provides code completion for XML-tags. Use CTRL+Space to choose XML-tag from list, obtain complete stub of XML-tag with ENTER. Plug-in extends this functionality with two features: 1) code completion/navigation for SQL-files, 2) code completion/navigation for the names of DTO-classes.

Compatibility of DTO and DAO

For example, you need to fetch some record from data table and represent it as DTO.

File 'getOrder.sql' contains SQL statement like: 'select * from orders where o_id=?'.

Step 1. Generate DTO class:

<dto-class name="Order" ref="getOrder.sql" />

Step 2. Generate the code to fill DTO:

<query-dto method="getOrder(o_id)" ref="getOrder.sql" dto="Order" />

In both steps, code generator uses the same database meta-data, so compatibility between fetched record and DTO is 100%.

Similar principle works in CRUD scenario.

Step 1. Generate DTO class:

<dto-class name="Product" ref="products" />

Step 2. Generate the code to fill DTO and use DTO as data source for SQL parameters:

<crud-auto dto="Product" table="products" />

Android

  1. A database with exactly the same schema as in your Android application must be located on development PC.
  2. To generate the code, use JDBC driver for SQLite. Successfully tested with Xerial sqlite-jdbc-3.8.9.jar.
  3. Sample implementation of 'DataStore' for Android is shipped with the plug-ins (tab 'Admin').
  4. JDBC drivers for SQLite do not provide type information for columns and parameters. If you need strongly-typed data access code, provide type names in XML meta-program.

External VM-files

There is a possibility to change VM templates used for code generation. Open internal VM-file: plug-in GUI, the tab 'Admin'. Copy paste VM-file to the project tree. Specify the path to VM-file in 'setting.xml', tag 'external-vm-file'. Change VM-file according to you needs.

Stored procedures and functions

...are not supported because working with them differs significantly depending on database provider.

For example, you obtain exception if you try to extract database meta-data from

SELECT INVENTORY_IN_STOCK(?)

(MySQL). At the same time, this one works:

SELECT INVENTORY_IN_STOCK(10)

Etc. etc. etc.