Dependencies can be used between Services and Entities, they
won't need any stereotype assigned to them. These dependencies
are used to reference an entity from another entity or service,
or to reference a service from an entity or another service.
Entity query operations (i.e. finders) can be denoted by setting the
query flag on the modeled operation to true
(they do not require any stereotypes).
Actors represent roles within your model. To designate that a role
has access to a given service you must draw a dependency from an Actor
to the
<<Service>>. To designate the
role has access to to a given operation, you must draw a dependency from
an Actor to the operation.
Transitive persistencein Hibernate is controlled by cascading Hibernate operations.
There are four points to adjust that:
the
hibernateDefaultCascadenamespace property:
the overall default for cascade
the
hibernateCompositionCascadenamespace
property:
how an UML composition should be interpreted as cascade
the
hibernateAggregationCascadenamespace
property:
how an UML aggregation should be interpreted as cascade
the
andromda_hibernate_cascade tagged value
at the individual association end
The idea is to visualize the cascading hierarchy by using UML composition and aggregation. The inverse
direction is marked with cascade="none" to get a clear direction.
AndroMDA Hibernate Cartridge Profile
This profile contains all elements that can be applied on the model used as the
MDA transformation process. These elements are specific to the AndroMDA Hibernate Cartridge component.
Stereotypes
Stereotypes are the names you sometimes see appear in UML diagrams, they typically look
like <<MyStereotype>> and can be applied on any type of UML model element.
Tagged Values
Sometimes it happens you want to add information to the model but there is no clean way
of doing it. In those cases you may want to resort to tagged values, but these cases should
be considered with caution. A tagged value is something extra, something optional,
and the application should run fine without them.
Entity(Back to Stereotypes) |
Applied on: class |
Denotes a class is representing an Hibernate POJO. This will instruct the cartridge to generate
an .hbm.xml descriptor and the corresponding class from it.
|
Service(Back to Stereotypes) |
Applied on: class |
Denotes a class is representing an EJB session bean that is supposed to be used as a facade
for a set of entities.
|
Enumeration(Back to Stereotypes) |
Applied on: class |
This class will instruct the generation of a type-safe enumeration class. The class implements the
required Hibernate interface to be able to be persisted. That way it is possible for Entities to
use this enumeration type for their attributes.
|
andromda_hibernate_query(Back to Tagged Values) |
Applied on: An Entity operation marked as a
query.
|
Defines a hibernate query expression. Note that it's encouraged
to model your query body as an OCL constraint (instead of using
this tagged value).
|
andromda_hibernate_inheritance(Back to Tagged Values) |
Applied on: <<Entity>> |
Used to override the default hibernate inheritance
strategy defined by the
hibernateInheritanceStrategy
namespace property.
Permitted values are:
- class - table per hierarchy.
- subclass - table per class in hierarchy.
- concrete - Table per class.
- union-subclass - Table per class (only on Hibernate 3).
-
interface - Root class is defined as
an interface and the attributes remapped to the subclasses.
This is useful in the concrete case because it has limitations
in the associations.
The tagged value of andromda_hibernate_inheritance
is set on the base/root class.
All subclasses must then follow the same strategy unless
interface or concrete is the predecessor strategy.
The default strategy is defined by the
hibernateInheritanceStrategy
namespace property.
|
Allowed values for this element:
- class
- subclass
- concrete
- union-subclass
- interface
|
andromda_hibernate_outerjoin(Back to Tagged Values) |
Applied on: Association ends between <<Entity>> classes |
Defines if Hibernate will use a outer join for fetching the given assocation end.
For Hibernate3 this will result in a fetch clause with values:
|
Allowed values for this element:
|
andromda_hibernate_generator_class(Back to Tagged Values) |
Applied on: <<Entity>> |
Used to define the generator class used for the hibernate entity.
Any of the hibernate generator classes may be used.
|
Allowed values for this element:
- increment
- identity
- sequence
- hilo
- seqhilo
- guid
- uuid
- uuid.hex
- uuid.string
- native
- assigned
- select
- foreign
|
andromda_hibernate_sort_type(Back to Tagged Values) |
Applied on: Association ends between <<Entity>> classes |
Used to define how elements will be sorted within the collection defined by the association. (Only
available for maps and sets)
This value overrides the
namespace property.
|
Allowed values for this element:
- unsorted
- natural
- comparatorClass
|
andromda_hibernate_version(Back to Tagged Values) |
Applied on: <<Entity>> |
Specifies wheter or not the entity will have a version property. If a value is present, then the
entity will have
a version property with the name specified within the tagged value.
|
Allowed values for this element:
- The name of the version property
|
andromda_hibernate_formula(Back to Tagged Values) |
Applied on: The attribute of an <<Entity>> |
Defines an attribute of a class as a calculated value. This tagged value
stores the SQL formula that will be used to assign a value to this property.
|
Allowed values for this element:
|
andromda_persistence_discriminator_column_name(Back to Tagged Values) |
Applied on: The <<Entity>> classes |
Used at the class level of an entity and is
optional. This value indicates the name of the
column to be used for the discriminator. If not
specified for the SINGLE_TABLE or JOINED inheritance
mapping strategies, then default to TYPE.
|
Allowed values for this element:
|
andromda_persistence_discriminator_type(Back to Tagged Values) |
Applied on: The <<Entity>> classes |
Used to override the default entity inheritance
discriminator type defined by the
entityDiscriminatorType
namespace property.
Permitted values are:
- STRING
- CHAR
- INTEGER
The tagged value of
andromda_persistence_discriminator_type is set
once on the base/root class to indicate the type
of the column used for the discriminator. The
default discriminator type is defined by the
entityDiscriminatorType
namespace property.
|
Allowed values for this element:
|
andromda_persistence_discriminator_value(Back to Tagged Values) |
Applied on: The <<Entity>> classes |
Used at the class level of an entity and is
optional. This is the value that indicates that the
row is an entity of the annotated entity type. It
should be specified for each class in the hierarchy.
|
Allowed values for this element:
|
andromda_hibernate_property_insert(Back to Tagged Values) |
Applied on: the attribute of an <<Entity>> |
Specifies whether a mapped column should be included in SQL INSERT
statements. Setting to false allows the column to be
initialized using other mechanisms such as a value defaulted by the
database. Defaults to true.
|
Allowed values for this element:
|
andromda_hibernate_property_update(Back to Tagged Values) |
Applied on: the attribute of an <<Entity>> |
Specifies whether a mapped column should be included in SQL UPDATE
statements. Setting to false allows the column to be
updated using other mechanisms such as a value defaulted by the
database. Defaults to true.
|
Allowed values for this element:
|
andromda_hibernate_xml_tagName(Back to Tagged Values) |
Applied on: the attribute of an <<Entity>>, or an the <<Entity>> itself,
or on an association end between <<Entity>> classes |
Defines the name of the XML element that is generated when
an entity, attribute, or associated entity is represented in XML format.
Valid only when XML persistence has been enabled. Controls the node
attribute in the Hibernate mapping file.
See also hibernateXMLPersistence
|
Allowed values for this element:
|
andromda_hibernate_xml_embed(Back to Tagged Values) |
Applied on: Association ends between <<Entity>> classes |
Specifies wheter or not the entity attached to the association end should be
embedded as a complete XML structure, or simply as a referenc to its ID.
Controls the embed-xml attribute in the Hibernate mapping file.
See also hibernateXMLPersistence
|
Allowed values for this element:
|