Annotating a class

 

Tagged values on a class

The tagged values used to annotate classes are presented in the following table:

 

The ... tagged value

Role

SQL

{fillfactor(value)}

Specifies the percentage of pages filled by the index.

WITH FILLFACTOR (Sybase)

{maxRowsPerPage(value)}

Specifies the maximum number of tuples per page.

WITH MAX_ROWS_PER_PAGE (Sybase)

cluster_name : {cluster(cluster_columns,...)}

Links the table to a predefined cluster.

CLUSTER (Oracle)

{initrans(value)}

Changes the characteristics of the table.

INITRANS (Oracle)

{maxtrans(value)}

Changes the characteristics of the table.

MAXTRANS (Oracle)

{pctfree(value)}

Changes the characteristics of the table.

PCTFREE (Oracle)

{pctused(value)}

Changes the characteristics of the table.

PCTUSED (Oracle)

{storage(clause)}

Changes the characteristics of the table.

STORAGE (Oracle)

{indexSpace(tablespace_name)}

Specifies the tablespace for the index.

TABLESPACE (Oracle)

{indexStorage(clause)}

Specifies the STORAGE class for creating the index.

STORAGE (Oracle)

{classAttributesTableName(table_name)}

Defines the name of the table which will contain all the class attributes, except those annotated {globalTable}.

 

{oneTablePerConcreteClass}

Indicates table mapping.

 

{oneTablePerClass}

Indicates table mapping.

 

{oneTable}

Indicates table mapping.

 

{oid}

Indicates that an attribute of "oid" type should be generated in the table corresponding to this class.

 

{tablespace(tablespace_name)}

Specifies the logical storage unit of the data.

TABLESPACE (Oracle), ON (Sybase)

{partition(number)}

Specifies the number of pages linked together in the table.

PARTITION (Sybase)

{keyName(key_name)}

Defines "unique" constraints.

 

{indexName(index_name)}

Declares an index associated to a table.

 

{indexOwner(index_owner)}

Declares the owner of an index.

{indexOwner(index_owner)}

{persistence(type_persistence)}

Indicates in the analysis model whether or not the class is persistent.

 

{indexClauses:primaryKey}

Specifies the "using index" clause for the primary key.

USING INDEX (Oracle)

{indexClauses:compositeKey}

Specifies the "using index" clause for unique keys.

USING INDEX (Oracle)

{indexClauses:indexKey}

Specifies the following clauses for indices:

"INITRANS"

"MAXTRANS"

"TABLESPACE"

"STORAGE"

"PCTFREE"

"NOSORT"

"RECOVERABLE"

"UNRECOVERABLE"

INITRANS, MAXTRANS, TABLESPACE, STORAGE, PCTFREE, NOSORT, RECOVERABLE, UNRECOVERABLE (Oracle)

{tableOwner(table_owner)}

Declares the owner of the table.

{tableOwner(table_owner)}

 

 

The {fillfactor} tagged value

The {fillfactor} tagged value specifies the fill factor of each index page. This must be between 1 and 100. If the fill factor is not defined, its default value is 0. A 0 fill factor creates indexes clustered with full pages and indexes which are not clustered by full page sheets.

 

Note:      For more information, please see volume 1 of Sybase SQL Server Reference Manual, page 3-79.

 

 

The {maxRowsPerPage} tagged value

The {maxRowsPerPage} tagged value is used to specify the maximum number of tuples per page in the table. This must be between 0 and 256. If it is not defined, its default value is 0. A 0 value creates indexes that are clustered with full pages and indexes which are not clustered by full page sheets.

 

Note:      For more information, please see volume 1 of Sybase SQL Server Reference Manual, page 3-80.

 

 

The {cluster} tagged value

The {cluster} tagged value is used to link the table to a pre-existing cluster (for example, one created within an "sqlbefore" item).


The descriptor of this tagged value provides the cluster's name, whilst the parameters correspond to the list of columns associated with the cluster.

 

 

The {initrans} tagged value

The {initrans} tagged value takes as its unique parameter the value of the Oracle parameter, with the same name as is generated in this case.

 

It must not be used with a cluster (for more information, please refer to the Oracle SQL documentation, page 4-210).

 

 

The {maxtrans} tagged value

The {maxtrans} tagged value takes as its unique parameter the value of the Oracle parameter, with the same name as is generated in this case.

 

It must not be used with a cluster (for more information, please refer to the Oracle SQL documentation, page 4-210).

 

 

The {pctfree} tagged value

The {pctfree} tagged value takes as its unique parameter the value of the Oracle parameter, with the same name as is generated in this case.

 

It must not be used with a cluster (for more information, please refer to the Oracle SQL documentation, page 4-210).

 

 

The {pctused} tagged value

The {pctused} tagged value takes as its unique parameter the value of the Oracle parameter, with the same name as is generated in this case.

 

It must not be used with a cluster (for more information, please refer to the Oracle SQL documentation, page 4-210).

 

 

The {storage} tagged value

The {storage} tagged value takes as its unique parameter the value of the Oracle parameter, with the same name as is generated in this case.

 

It must not be used with a cluster (for more information, please refer to the Oracle SQL documentation, page 4-210).

 

 

The {indexSpace} tagged value

The {indexspace} tagged value is used to specify the "tablespace" where the class index will be created.

 

 

The {indexStorage} tagged value

The {indexStorage} tagged value is used to specify the "STORAGE" Oracle clause for indexes. The parameter of this tagged value must contain, between inverted commas, the different Oracle parameters associated with a parameter's values. For example:

 

"INITIAL 1024 NEXT 2048"

 

 

The {classAttributesTableName} tagged value

The {classAttributesTableName} tagged value is used to indicate the name of the table which will contain all those class attributes of this class not annotated {globalTable}.

 

 

The {oneTablePerConcreteClass} tagged value

The {oneTablePerConcreteClass} tagged value is the default generalization table mapping mode. It associates a table in the physical model with each concrete class.

 

 

The {oneTablePerClass} tagged value

The {oneTablePerClass} tagged value is used to specify the generalization table mapping mode. This mode generates, for each modeled class, a table in the physical model. The rules for the previous transformation then apply to all classes, without exception.

 

 

The {oneTable} tagged value

The {oneTable} tagged value is used to specify the generalization table mapping mode. This mode generates a single table containing the set of attributes for all the tables which make up a generalization tree.

 

 

The {oid} tagged value

The {oid} tagged value is used to indicate that a primary key "oid" attribute must be generated.


If this tagged value has no parameters, the type of this attribute depends on the RDBMS selected in the "Database" module parameter (this is ROWID type for Oracle, and INTEGER with the IDENTITY option for Sybase). The user can add an "integer" parameter, indicating that the attribute will be an integer, or the "string" parameter, indicating that the attribute will be a string.


This tagged value must only be used on logical model classes.

 

 

The {tablespace} tagged value

For Oracle, the {tablespace} tagged value is used to specify the logical storage unit of the data. Classes not annotated {tablespace} are stored in the SYSTEM tablespace.


For Sybase, the {tablespace} tagged value is used to specify a specific segment of allocation of the table's pages. The segment will have to have been created first by the adminstrator, using the following procedure:

 

sp_addsegment



The {partition} tagged value

The {partition} tagged value specifies the number of chain pages in the table. It allows the SQL to execute insertions at the same time on the last page of each chain. The partition must be greater than or equal to 2. By default, there is only one chain of pages per table.

 

Note:      For more information, please see volume 1 of Sybase SQL Server Reference Manual, page 3-15

 

 

The {keyName} tagged value

The {keyName} tagged value allows you to declare a composite key on the table associated with the class. The parameter must contain the composite key name. The composite key content is defined with {keyName} tagged values on the attributes belonging to it. Several composite keys can be declared for the same class.

 

 

The {indexName} tagged value

The {indexName} tagged value allows you to declare an index on the table associated with the class. The parameter must contain the index name. The index content is defined with {indexKey} tagged values on the attributes belonging to it. Several indexes can be declared for the same class.

 

 

The {indexOwner} tagged value

The {indexOwner} tagged value is used to indicate the owner of an index.  It is linked to the {indexName} tagged value associated via a dependency.  If this is not indicated, the owner of the index is the same as the owner of the table that uses this index.

 

 

The {tableName} tagged value

The {tableName} tagged value is used to indicate the owner of a table.  If this is not indicated, the owner of the table is the schema inside which the table is contained, if this exists.  Otherwise, no owner is defined for this table.

 

 

The {persistence} tagged value

The {persistence} tagged value's parameter is used to indicate whether or not the class is persistent. If the parameter is (persistent), the class is persistent and has an equivalent in the physical model (a table). If the parameter is (transient), the class is not persistent.

 

 

The {indexClauses:primaryKey} tagged value

The {indexClauses:primaryKey} tagged value is used to specify the "using index" clause for the primary key. The parameters must contain the clause's type (INITRANS, MAXTRANS, PCTFREE, STORAGE, TABLESPACE, RECOVERABLE, UNRECOVERABLE), its value and a string of empty characters.


For example:

 

{indexClauses:primaryKey("STORAGE",

"INITIAL 1024 NEXT 2048", "")}

 

 

The {indexClauses:compositeKey} tagged value

The {indexClause:compositeKey} tagged value is used to specify the "using index" clause for unique keys. The parameters must contain the clause's type (INITRANS, MAXTRANS, PCTFREE, STORAGE, TABLESPACE, RECOVERABLE, UNRECOVERABLE), its value and the name of the composite key.


For example:

 

{indexClauses:compositeKey("PCTFREE", "20", "myKey")}

 

 

The {indexClauses:indexKey} tagged value

The {indexClauses:indexKey} tagged value is used to specify the INITRANS, MAXTRANS, PCTFREE, STORAGE, TABLESPACE, RECOVERABLE, UNRECOVERABLE clauses on an index. The parameter must contain the clause's type, its value and the name of the index.


For example:

 

{indexClauses:indexKey("RECOVERABLE", "true", "myIndex")}

 

Note:      The {indexClauses:indexKey("STORAGE", <value>, <index_name>)} and {indexClauses:indexKey("TABLESPACE", <value>, <index_name>)} replace the {indexStorage(<value>)} and {indexSpace(<value>)} tagged values respectively. A procedure automatically carries out the update when the MDAC is deployed. However, this procedure can be disrupted if read-only elements are present. In this case, we recommend that you proceed with a manual replacement.

 

 

Notes on a class

The notes used to annotate classes are presented in the following table:

 

The ... note type

is used to...

sqlBefore

indicate the SQL code to be added to the .SQL file before the SQL code corresponding to the modeled class.

sqlAfter

indicate the SQL code to be added to the .SQL file after the SQL code corresponding to the modeled class.

 

 

Stereotypes on a class

The stereotypes used to annotate classes are presented in the following table:

 

The ... stereotype

is used to...

<<procedureClass>>

specify that the class only contains stored procedures.

<<table>>

indicate that the class is an SQL table.

<<sqlView>>

describe an SQL view.

 

 

The <<sqlView>> stereotype

To specify the "select" clause constituting the definition of the view, you must:

·         attach to the class or to the table an operation stereotyped <<createView>>

·         annotate the <<createView>> operation with an "sqlCode" type note, which must contain the "select" clause