Tutorial Page

This page explains how to operate minuteProject for your particular model.

Introduction

The user can get inspiration from the demo page, or the target architecture page.
Meanwhile the demos are limited to:
  • Hsqldb as target database;
  • Petshop for the model.
In reality other the user wants to make some adaptation for other database, model...

Steps

Three steps are needed:
  • Data model properties and enrichment configuration;
  • Choosing a target architecture;
  • Running minuteProject.

Main configuration

The main configuration file holds the information relevant to:
  • Model: name, version, root package
    • Data Model
      • Datasource (mandatory) driverclassname/URL/username/password
      • Schema (mandatory for DB2/Oracle) not for HSQLDB/Mysql
      • Primary key policy
        • sequence based
        • identity based
    • Business Model
      • Generation condition: to include/exclude entities, or group of entities.
      • Business package: enrichment indicating the business package of an entities, or group of entities.
        • Example tables starting with 'ADMIN_' goes to package 'administration'...
      • Enrichment: adds properties to entities or field that can be uses by the templates (Ex indicating a table holds 'reference-data' can be use to generate cache related artifacts...).
        • TODO
  • Target: specifies the location of
    • the target architecture file
    • the output directory
    • the template root: where the templates should be looked-up.

Target architecture configuration

Target architecture configuration gathers the target architecture templates metadata.
Those metadata are used be the generated templates to discover its environment: where are its dependencies located? How can I make a correct import, give a correct variable name...

MinuteProject delivery bundles the target architecture configurations for various target (current features/ incubator features in /demo/config/mp-template*).
The user can:
  • Use them as is;
  • Change some naming convention inside: Ex the user does not like a subpackage naming convention, he can change it there, and the generated code will still make the correct reference.
  • Extend or Create new targets. //TODO


Running minuteProject

Dependencies

The libraries to run minuteProject are located in
  • /application/lib for the kernel
  • /application/lib/extra for the jdbc driver
Add the following libraries to your classpath (if the user has other jdbc drivers that those shipped, add them too).

Command


When generating for tables the main class is net.sf.minuteProject.application.ModelGenerator and pass as argument the main configuration file (that has to be in the classpath too).

When generating for entities (tables/views) the main class is net.sf.minuteProject.application.ModelViewGenerator. For some target technologies (hibernate/JPA) the Views entities should be enriched with a 'virtual primary key' attribute since those technologies need it.