«Field»
Stereotype «Field»
is used to map attributes of persistent objects to a relational database. Due to that the stereotype can only be applied on classes with stereotype «Persistent Object». Persistence frameworks will map attributes to the database using so called property mapping. This means that for every attribute there will be a row on the database. The mapping between Java and SQL type will be done automatically by default. Using tagged value sqlType
it is also possible to define a custom mapping.
Attributes of persistent classes which do not have stereotype «Field»
are considered to be transient.
Stereotype |
| |
Applicable Elements |
| |
Tagged Values | ||
Name | Type | Description |
|
| Attribute defines the name of the row that is used when mapping the attribute to the database. If the name is not set then the name of the attribute is also used as row name of the table. |
|
| Attribute defines the SQL type that is used to store the attribute on database level. Type can be used to override default behavior. |
|
| Attribute defines the amount of characters for an attribute on database level. Usage of this attribute is only supported for attribute in UML model is of type |
|
| Attribute defines the precision that is used to store numeric values on the database. Attribute is only supported in combination with numeric values. |
|
| Attribute |
|
| Optional attribute can be used to define the name of a simple index for that attribute. |
|
| Attribute defines if the attribute needs to be unique within the whole database table or not. Default: |
|
| Attribute defines if the attribute may be null on the database. Default: |
For further information please refer to: