Wednesday, July 18, 2012

Minuteproject with databases


Minuteproject works with different relational databases.
In the distribution, test have been done over couple of DB (oracle, mysql...). Meanwhile your database might not be present in the list.
This article summarizes the step to follow to add your database type and test it with minuteproject.


Add your driver

Minuteproject works over jdbc to retrieve the database metadata. So you need a driver.
Download your jdbc driver and add it in /application/lib/extra


From the config

You have to add in the data-source node
  • driver
  • url
  • username
  • password 
 Add in schema node
  • schema (should be the same as user) in the schema node.

From the console

The console choose its target database from the database-catalog.xml file located in /catalog
If you open it add a new entry similar to the previous one specifying what is your default primary-key strategy and other information.

Feed back

Feed-backs are welcomed to improve the catalog of database available.

Friday, July 13, 2012

working generated updatable code with MP 4 Openxava


In this article the user will learn how to keep Openxava modified-generated code based on Minuteproject 4 updatable code.


Minuteproject offers generated code for Openxava technology.
We will generate one project.
Make a build to get:
  • a working OX Defaulting app
  • a OX workspace
Alter the code
Generate again and ensure that your modification are kept.

MP 4 OX updatable code

Minuteproject provides for updatable code fonctionalities.
When you generate for Openxava, you have to specify that the generated code goes into the OX workspace.
This is because the MP 4 OX is a two-step process.
  • The first you generate the OX code.
  • The second, when you execute build-.cmd/sh, you:
    • build the OX workspace and copy the generated code
    • compile, package, deploy

The code that you modify is the code of the workspace so it generated code should point to the workspace.

If you choose another directory for generation, the process will work fine the first time and all the time you working with reverse-engineering only. But if you alter your code, then when you make the second operation then your modification are erased.

When the generation points to the workspace then only once the two-step process is needed. The second step initiates the project into the workspace.
Once done, no need to run the second step again.
You can alter both your generated code (as described here)
You can also alter your DB model and generate again, your modifications are generation-safe.


Under construction
This example show how to add business rules with ABL and JSR303 into the Minuteproject generated code for OX.
It use Minuteproject 0.8.2 and Openxava 4.5

Add sample config


Build workspace

Alter code

Alter model