Airlift UML Convertor – Tags and Stereotypes


This document describes, for the Airlift UML converter:

When Tags are not explicitly defined in the UML, defaults are provided, so the Tags should not be needed unless a detail control of the Hibernate Object-relational mapping is required.

Notes:

Airlift Tags allowed in UML:

Tag Name

Where Defined

Default
(can be globally overriden by Global Default)

Allowed Values

Description

Global Default

transient

Association

False”

True/false

If “true”, association is not persisted


table

Association

Association name (See Hibernate)

Any

Table name created for a many to many association.


reverse

Association

Table name

Any

If set, defines name of the association in reverse direction (also, accessors are defined to reach from parent to child as well as from child to parent). Without defining “reverse” on associations, generated java code only has getters to reach in one direction of the association.


FKFrom/To

Association

In Brief: Entity name on other side of association + “Id”

In Detail:
FKTo:
For MANY-TO-ZERO_OR_ONE: defaults to <toEntityName>ID
For ZERO_OR_ONE-TO-MANY: defaults to <fromEntityName>ID
For MANY_TO_MANY: defaults to <toEntityName>ID

FKFrom:
For MANY-TO-ZERO_OR_ONE: defaults to <fromEntityName>ID
For ZERO_OR_ONE-TO-MANY: defaults to <toEntityName>ID
For MANY_TO_MANY: defaults to <fromEntityName>ID

Any

Foreign Key on table on “opposite” side of association. Note that the “From” and “To” refers to table where the key is located, NOT key name. For example, if we have ParentTable, ChildTable and “parentHasChildren” association going from ParentTable to ChildTable, only FKTo makes sense, and for FKTo=”ABC”, an ABC column is created on the ChildTable, pointing to ParentTable.


propertyNameFrom/To

Association

Association Name (for <set>)
Entity Name on the “opposite end” of association (for <many-to-one>

Any

Defines the “name=” attribute on the <set name=..>, <many-to-many name=…> <many-to-one name=…> elements


accessorFrom/To

Association

Set” (default on MANY end)
Java Reference (default on 1 end)

Set,List.Map, Reference

Accessor type on the “Many” side of association. Set is translated to Hashset, Map to HashMap, List to LinkedList, otherwise it is pass-through, so user can set this to, for example, ArrayList.


cascadeFrom/To

Association

none”

all
delete
save_update
none (default)

If different from “none”, a delete cascades to entity in association direction. For details, see how Hibernate handles cascading.


lazyLoadFrom/To

Association

False”(See Hibernate)

True/false

If true, entity in association direction is loaded only when first needed


keyColumnFrom/To

Association

PERSIST_MAP_KEY” (map only)

Feature not implemented on java side of convertor.

Defines key column name for accessorFrom/To=Map mappings.

airliftj.uml.db.persistMapKeyColumnName

keyTypeFrom/To

Association

String”

Feature not implemented on java side of convertor.

Defines key column type for accessorFrom/To=Map mappings.

airliftj.uml.db.persistMapKeyColumnType

indexColumnFrom/To

Association

PERSIST_LIST_INDEX”
(list only)

Feature not implemented on java side of convertor.

Defines index column name for accessorFrom/To=List mappings.

airliftj.uml.db.persistListIndexColumnName

indexTypeFrom/To

Association

integer”

Feature not implemented on java side of convertor.

Defines key column type for accessorFrom/To=List mappings.

Frame1

===============

=======

================

=========

==============================


table

Class(Entity)

Entity Name

Any

Name of the table in database.


transient

Class(Entity)

False”

True/false

If true, Class is not persistent.


primaryKeyColumnName

Class(Entity)

Id”

Feature not implemented on java side of convertor.

Defines name of the primary key on the database table.


inline

Association

False”

True/false

Equivalent to using inline entity in UML, this is not needed.










Airlift Stereotypes Allowed in UML:

Stereotype

Where Defined

Description

EntityType

Class(Entity)

Must be set for the entity to be converted and generated as Airlift/Hibernate

OptionCode

Class(Entity)

If defined, the entity is treated in a special way in Airlift, essentially maintained in a “option codes table” which is cached and accessed quickly.

ExternalEntityType

Class(Entity)

If set, entity is not converted but any associations to it are converted (unless set to ExternalAssociationType).

ExternalAssociationType

Association

If set, entity is not converted but any associations to it are converted