JeeWiz Home  
The Model-Driven System Builder
JeeWiz Modeler's Help File for RSA/RSM
 
Contents  >   3.  The Persistence Tier
 


3.3 How to Model an Attribute

Attributes are the name for data objects on the entity, linking to columns in the table backing the entity. To add an attribute to an entity, right-click on the entity, either in the diagram editor or the model explorer, add UML, attribute. Alternatively, select the entity, go to the attributes tab on the properties view and press the small square to the right hand side.

You will need to fill in a name, and stereotype the property as an attribute. By selecting the attribute on the diagram or in the model explorer you can add the stereotype in the stereotype tab of the properties view. This will also make the JeeWiz attribute properties available.

There are three properties to work with on the general tab. The name, the type and the default. Visibility and qualifiers are unused, and multiplicity is only used in relationship mapping. RSA does not like you entering a default value unless you have entered a type. You should select the type from the JeeWizScreenMMLibrary choices. If you want the field to be a String with no default value, there is no need to enter a type.

Unless overridden the attribute name will match to a column name the same as itself unless the name is database reserved word, this will be altered by having a suffix of _j added to the column name. If you want to override this, you can set the dbmsColumn property to the column name. If you want the attribute to be stored as something else, you can for example set the dbStyle = StringYN, which will let you store a boolean as a Y or N text string as opposed to the default 1 or 0.

If you want to model the attribute as a not null column you can set the required property to true. This is unnecessary for attributes flagged as autokey and key, which are automatically required.

The autokey and key properties are explained in "How to model keys", externalName in "How to name names" and all the constraint fields in "How to apply constraints".

The other properties are used in the maintenance dataview and pages that are automatically created for the entity, and are copied up to the relevant dataview fields.


Links:  

Copyright © 2001-2006 New Technology / enterprise Ltd.