Demonstration Page


MinuteProject package is shipped with demonstrations of standard generation applications.
The user, that does not want to run them, can see the result of the demonstration by downloading the file demo-src-generated-<version>.zip at sourceforge
Those demos illustrate the reverse-engineering capabilities against a sample DB model (petshop database) for different target technologies.

Available generations

Those are located in demo/config
Generation Name
Command line script
Description
Spring/Hibernate standard
demo-hibernate
Generate a stack on top of Spring and Hibernate (Spring_hibernate)
Spring/JPA standard
demo-jpa
Generate a stack on top of Spring and JPA/Hibernate (Spring_JPA)
Spring/iBatis
demo-ibatis
Generate a stack on top of Spring and iBatis (Spring_iBatis)
Spring/Hibernate last features
demo-last-features
same as for standard Spring/Hibernate + advanced DAO + ehcache + maven (pom) + unit test
Spring/JPA last features
demo-draft-last-features-spring-jpa
same as for standard Spring/JPA + advanced DAO + ehcache + maven (pom) + unit test
FitNesse
demo-fitnesse
Generate FitNesse wikis + fixtures + DB reset scripts and fixtures (FitNesse)
Vaadin front end
demo-draft-features-vaadin-spring-hibernate
Generate vaadin frontend stack that interface the Spring/Hibernate last features
OpenXava
demo-last-features-openxava
Generate openxava project artifacts (Domain object JPA+presentation annotation,
JSP, navigation, menu ...)
jOOQ
demo-jooq
Generate jOOQ pom.xml + jOOQ artifacts + jOOQ generator input
Roo
demo-last-features-roo
Generate Roo console compliant input as well as .aj files to overwrite the default conventions.
Grails
demo-last-features-grails
Generate Grails application compliant project artifacts (gorm, controllers, configs...)
for web and REST
Play
demo-last-features-play
Generate Playframework application compliant project artifacts (model, view...)
for web and REST
JPA2
demo-JPA2
Generate JPA2 Classes with annotation and the associated metamodel to write compilable queries
BSLA-JPA2
demo-JPA2-BSLA
Generate Basic Spring Layer configuration and DAO on top of JPA2 persistence layer
Solr
demo-solr
Generate Solr configuration artifact based on enrichment made over 'searchable' entities
JSF-primefaces
demo-JSF-primefaces
Generate Primefaces front-end on top of a EJB/JPA2 layer with maven integration
JSFprimefaces-spring
demo-JSF-Spring-primefaces
Generate Primefaces front-end on top of a Spring/JPA2 layer with maven integration for
Model reverse-engineering and SDD.
REST-JEE
demo-REST-JEE
Generate a REST CRUD access on top of JPA2+JAXB layer
REST-CXF
demo-REST-CXF-spring
Generate a REST CRUD app with CXF on top of a spring BSLA-JPA2 backend
REST-SpringMVC
demo-REST-SpringMVC
Generate a REST CRUD app with SpringMVC on top of a spring BSLA-JPA2 backend
WS-JEE
demo-WS-JEE
Generate a WebService CRUD access on top of JPA2+JAXB layer

Run

Prerequisite check that you have java 1.6+ in your path and JAVA_HOME. Otherwise set it in the command script.

  1. Go to <MP_HOME>/demo/config
    1. To run all demos : all-demos.cmd or ./all-demos.sh on Linux
    2. A specific one (ex: demo-jpa2.cmd)

The generated code goes to demo/output/<generationName> (ex: demo/output/petshopLastFeature)

How it works

Command line

The command line script executes the following line

"%JAVA_HOME%\bin\java" %CP% net.sf.minuteProject.application.ModelViewGenerator mp-config-JPA2.xml

passing the configuration file mp-config-JPA2.xml as argument to ModelViewGenerator class.

Enrichment

ModelViewGenerator will load the 'Enriched Data Model config'
Here is a sample the enrichment:
<!DOCTYPE root>
<generator-config>
    <configuration>
        <model name="petshop" version="1.0" package-root="sf.net.mp.demo">
            <data-model>
                <!--  --><driver name="hsqldb" version="1.8.0.7" groupId="hsqldb" artifactId="hsqldb"></driver>
                <dataSource>
                    <driverClassName>org.hsqldb.jdbcDriver</driverClassName>
                    <url>jdbc:hsqldb:hsql://127.0.0.1:9001/petshop</url>
                    <username>sa</username>
                    <password></password>
                </dataSource>
                <!-- for Oracle and DB2 please set the schema
                <schema> </schema>
                 -->
                <primaryKeyPolicy oneGlobal="true" oneForEachTable="false">
                    <primaryKeyPolicyPattern prefix="" suffix=""
                         name="sequencePattern" sequenceName="hibernate_sequence"></primaryKeyPolicyPattern>
                </primaryKeyPolicy>
            </data-model>
            <business-model>
                <generation-condition>
                    <condition type="exclude" startsWith="DUAL"></condition>
                </generation-condition>
                <business-package default="pet">
                    <condition type="package" startsWith="TB_" result="other"></condition>
                </business-package>
                <enrichment>
                    <entity name="CATEGORY" content-type="reference-data" />
                </enrichment>
            </business-model>
        </model>
        <targets catalog-entry="JPA2" />
    </configuration>
</generator-config>
Which means:
  • The model
    • has the following attributes: name, version, root package
    • is accessible by the following connection parameters (in node dataSource)
    • has the following driver properties (used for maven)
  • It has a primary key policy stating that:
    • it is based on one sequence
    • the sequence 'hibernate_sequence'
    • It is for the table that need it (not for m2m or natural id)
  • The generation will exclude table Dual
  • By default all tables will go in package 'pet' except those starting with 'TB-' that goes in package 'other'
  • The table category is considered to hold reference-data.
  • This enrichment will be
    • passed to the template 'mp-template-JPA2.xml'
    • setting a default output directory to ../output/petshop/JPA2.

Additional information about how to enrich your model can be found here.