-
Notifications
You must be signed in to change notification settings - Fork 6
Behavioural entities
Julien Delplanque edited this page Feb 8, 2018
·
4 revisions
A BehaviouralEntity is an entity that perform developer-defined action(s) at runtime. Thus, it inherits fromSourcedEntity because it has to hold the source code String of the body of the entity. The source code of the body of this entity is written in a programming language accepted by the DBMS. For example, queries are written in SQL, in PostgreSQL the source code of StoredProcedures could be written in PL/pgSQL.
The BehaviouralEntity class has 3 direct subclasses:
-
QueryContainer, an abstract class modelling the fact that aBehaviouralEntitycan contain queries in its source code. -
Triggerwhich models a set of actions executed when a particular event happens to a table (e.g. row insertion, row deletion, row update, etc…); and -
CheckConstraintbecause a check constraint contain an expression allowing to decide if a value for a column is valid or not. Nonetheless, a check constraint's expression can not use queries.
The QueryContainer class has 3 direct subclasses
-
StoredProcedurewhich models a user-defined function; -
Viewwhich, additionally to its inheritance from ColumnsContainer, inherits fromQueryContaineras well because it contains a source code string containing the SelectQuery used to build the View. -
DerivedTablewhich, additionally to its inheritance from ColumnsContainer, inherits fromQueryContainerfor the same reason as the view.