Introduction

This page describes the enrichment that can be brought to the model to exploit the richness of OpenXava displaying facilities.
Giving properties, adding concepts to your data model will trigger specific generation of artifacts matching different layers of OpenXava architecture.
Detail configuration can be found in the configuration page.

Enrichment

Scoping your model

MinuteProject allows you to define which entity you want (or not) to generate against.
<generation-condition >
  <condition type="exclude" startsWith="SYS_ADMIN_"></condition>
</generation-condition>
The entities starting with SYS_ADMIN_ will not be part of the generation.

Many 2 Many

The many-2-many entities are not part of the generation. MP considered an entity to be many-2-many if it is composed of 2 fields, each field is a foreign key, the primary key is made of both field.
Meanwhile both parent entities (of the many-2-many entity) have the JPA annotation @ManyToMany pointing to the other end entity.

Primary key Policy

Setting your primarykey policy.
<primaryKeyPolicy oneGlobal="false" oneForEachTable="true">
  <primaryKeyPolicyPattern prefix="" suffix="_SEQ" name="sequencePattern">
  </primaryKeyPolicyPattern>
</primaryKeyPolicy>
This will create JPA annotation using sequence for all entities having 'numeric' primary key.

Typing a field

Add stereotype on a field
On the node generator-config.configuration.model.business-model.enrichment add an entity and field node and specify the stereotype. The stereotype attribute value must match an OX stereotype.
Ex:
<entity name="SITE">
    <!--<field name="field-name">-->
    <field name="URL">
        <!--<stereotype stereotype="OX-stereotype"/>-->
        <stereotype stereotype="WEBURL"/>
    </field>
</entity>
MP will use the following snippet to generate an annotation @Stereotype ("WEBURL") for the member 'url' of the entity 'site'.

Referencing entities

Your entities are differents in term of the information content they hold.

In MinuteProject configuration, you can specify what is the content type of an entity.
There are mainly 3 types of content:
  • Reference data: table holding a limited amount of information usually managed by an admin process.
  • Pseudo-static data: table holding business information that seldom change.
  • Live-business data: table holding information frequently inserted/updated.

In fact, those concepts are commonly used not really expressed at the database nor at the UML level.
MinuteProject allows you to express them, and so the target technologies can beneficiate of this valuable information.
In Openxava, you can take advantage of this enrichment the following way:
Entity tagged with the content-type set to reference-data and with a field tagged as 'semantic-reference' will be accessed a Drop Down List with the semantic-reference field as input.

Ex:
<entity name="ENVIROMENT" content-type="pseudo-static-data">
  <semantic-reference>
    <sql-path path="NAME"/>
  </semantic-reference>
</entity>

All the entities that reference 'environment' entity will access it via a Drop Down List instead of a look-up Sub-UseCase.
It will generate the OX annotation @DescriptionsList with the descriptionProperties attribute set to the values set in the sql-path.path value.

Constraining a field

Constraint enum on a field => gives a drop down list (static) + related sql constraint ddl.
TODO add snippet

Views

Working with views

Working with views and not only with tables, allows you to create entire new perspectives on your model. For example, adding some BI, report, other ways to navigate your model.

Use View

To be able to use a view, it is mandatory to assign a 'virtual' primary key to one field.
see configuration

Nesting View

A field from a view can reference the 'virtual' primary key of another view.
see configuration