| ERW: The Manual | ||
|---|---|---|
| <<< Previous | Next >>> | |
A restricted identifier for this attribute. Note that the identifier is not an XML identifier, so you can use the same attribute identifier for attributes of different types.
A label for this attribute. The user will be always presented with this label when dealing with the attribute.
A detailed help text for this attribute (for tooltips).
An ERL type for this attribute. If not specified, it is assumed to be VARCHAR.
If the type attribute
is set to enum and you want to specify a
static enumerative type, you should specify here the XML
identifier of an enum
element.
If the type attribute
is set to fset and you want the generated
fileset to have attributes, you should specify here the XML
identifier of an fset
element.
For the types for which it is meaningful, the size of the attribute. For text types, it is the maximum number of characters that can be stored, and defaults to 255. For numeric types, it is the number of meaningful digits.
For numeric types, the scale, that is, the number of fractional digits (by default, 0). Note that the scale is included in the size, so a numeric type with size n and scale s has n-s digits to the left of the point and s digits to its right.
A JavaScript regular expression defining the valid content of this attribute. This is meaningful only for text and numbers, and provides a generic, flexible way of checking user inputs. The user will be prevented from setting the content of this attribute to a string that does not conform to the regular expression. Note that the empty string is always a valid input for a non-mandatory attribute.
![]() | The input provided by the user is valid if it matches somewhere the regular expression; if you want to give a tight constraint (i.e., on the whole content), you should start your expression with ^ and end it with $, as usual. Note that, to avoid to confuse the user, it is probably a good idea to permit trailing spaces. |
A default value for this attribute. The allowed content
depends on your database, although by SQL-99 standard you can
use a literal, CURRENT_DATE,
CURRENT_TIME and a few other specifiers (in
PostgreSQL you can use any variable-free SQL expression). For
example, by setting default
to CURRENT_DATE for a date the user will be
presented with the current date as default value.
![]() | ERW can perform little or no check on the content of this attribute. Try to use standard SQL constructs for portability, and check carefully the resulting type. In particular, constant strings must be quoted (e.g., default="'a string'"). |
This field can be set to true or false (the default). In the first case, the user is required to insert some data for this attribute.
This field is meaningful only for ERL text types, and can be set to true (the default) or false. In the first case, this attribute will be trimmed. More precisely, trimming happens following the ERW type associated (see the Section called ERL Types vs. ERW Types in the Chapter called Customisation): for type pw, no trimming; for type t, left and right trimming; for type a, left trimming.
This field can be set to true or false (the default). The set of fields for which this attribute is true constitutes the key set of the entity or fileset. ERW will prevent you from inserting two elements with the same key set. Note that for weak entity types the leg of the identifying functions are part of the key (see rel).
This field can be set to true or false (the default). In the first case, the user is never presented with the attribute, but the attribute is retrieved and rewritten without change on updates. This allows to create fields to store additional information not edited through ERW (but maybe computed each time the element is updated).
An attribute that is not of type enum or fset is reified by an SQL column in the obvious way. Enumerative types of identifier attribute-name generate a column named attribute-name in the case of a static enumerative attribute (and the type of the column will be given by the static enumerative type), whereas they will generate a column named id_attribute-name of SQL type INT in the case of a dynamic enumerative attribute. This column points to a table named entity-type_attribute-name that contains the actual elements of the type. The table can be edited much like an entity table.
As we mentioned previously, attributes of type fset do not generate an SQL column, but rather a support table (again, named entity-type_attribute-name) containing the attributes of the fileset, if a file set type is present, and two additional columns: file, holding the actual name of a file in the file system, and id_belongs_entity-type. Each file stored in the fileset points to the entity it belongs to using the latter column.
| <<< Previous | Home | Next >>> |
| fset | Up | isa |