-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better example
- Loading branch information
Showing
4 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
table x | ||
{ | ||
x_code INTEGER; | ||
y_code SMALLINT; | ||
z SMALLINT; | ||
}; | ||
identifier for x is x_code; | ||
table state=y | ||
{ | ||
y_code SMALLINT; | ||
state_name=y_name VARCHAR; | ||
}; | ||
identifier for y is y_code; | ||
connection between x and y | ||
{ | ||
y_code = y_code; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
operation "delete an x" | ||
{ | ||
p_x_code; | ||
} | ||
preconditions | ||
{ | ||
exists x child (x_code=p_x_code and z>100); | ||
exists state parent (state_name = 'Inactive'); | ||
connection between child and parent; | ||
} | ||
postconditions | ||
{ | ||
deleted child; | ||
} | ||
comment 'Delete an x instance if it is in the state | ||
inactive and its z value is bigger than 100. | ||
|
||
Contracts refer to the elements in the conceptual data model. | ||
Conceptual data model specifies entity type state with an attribute state_name. | ||
In the database corresponding table and column names are y and y_name, respectively. | ||
The mapping is specified in the context description.'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters