Annotating an operation

 

Tagged values on an operation

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

 

The ... tagged value

Role

SQL

{tgInsert}

Indicates that the code for the operation containing an "sqlCode" note is a trigger set off on an "insert" operation.

(ON) INSERT

{tgUpdate}

Indicates that the code for the operation containing an "sqlCode" note is a trigger set off on an "update" operation.

(ON) UPDATE

{tgDelete}

Indicates that the code for the operation containing an "sqlCode" note is a trigger set off on an "delete" operation.

(ON) DELETE

{tgBefore}

Indicates that the trigger operation must be run before updating the database (Oracle).

BEFORE

{tgAfter}

Indicates that the trigger operation must be run after updating the database (Oracle).

AFTER

 

 

The {tgInsert} tagged value

At least one of the {tgInsert}, {tgUpdate} and {tgDelete} tagged values must be present on an operation stereotyped <<trigger>>.  They determine when the trigger is launched.

 

 

The {tgUpdate} tagged value

In Oracle, the user can add as parameters the names of the columns which must be observed for update.

 

At least one of the {tgInsert}, {tgUpdate} and {tgDelete} tagged values must be present on an operation stereotyped <<trigger>>.  They determine when the trigger is launched.

 

 

The {tgDelete} tagged value

At least one of the {tgInsert}, {tgUpdate} and {tgDelete} tagged values must be present on an operation stereotyped <<trigger>>.  They determine when the trigger is launched.

 

 

The {tgBefore} tagged value

In Oracle, one and only one of the {tgBefore} and {tgAfter} tagged values must be defined on an operation stereotyped <<trigger>>.

 

 

The {tgAfter} tagged value

In Oracle, one and only one of the {tgBefore} and {tgAfter} tagged values must be defined on an operation stereotyped <<trigger>>.

 

 

Notes on an operation

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

 

The ... note type

is used to...

sqlCode

indicate the SQL code of an operation, so as to allow the entry of the code for a stored procedure or a trigger.

 

 

Stereotypes values on an operation

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

 

The ... stereotype

is used to...

<<createView>>

indicate that the operation contains SQL code, placed on an "sqlCode" note, allowing a view to be created.

<<trigger>>

indicate that the operation is a trigger.

<<storedProcedure>>

indicate that the operation is a stored procedure.

 

 

The <<createView>> stereotype

The <<createView>> stereotype indicates that the operation contains SQL code, placed in an "sqlCode" note, which allows the creation of a view.

 

This stereotype must be placed on a class stereotyped <<sqlView>>.

 

 

The <<trigger>> stereotype

The <<trigger>> stereotype indicates that the operation is a trigger.  The SQL code of the trigger must be contained in an "sqlCode" note.

 

The operation must be annotated by at least one of the {tgInsert}, {tgUpdate} and {tgDelete} tagged values.

 

In Oracle, the operation must also have either the {tgBefore} or {tgAfter} tagged value present.

 

 

The <<storedProcedure>> stereotype

The <<storedProcedure>> stereotype indicates that the operation is a stored procedure and contains SQL code placed in an "sqlCode" note.