Skip to content

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 a BehaviouralEntity can contain queries in its source code.
  • Trigger which models a set of actions executed when a particular event happens to a table (e.g. row insertion, row deletion, row update, etc…); and
  • CheckConstraint because 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

  • StoredProcedure which models a user-defined function;
  • View which, additionally to its inheritance from ColumnsContainer, inherits from QueryContainer as well because it contains a source code string containing the SelectQuery used to build the View.
  • DerivedTable which, additionally to its inheritance from ColumnsContainer, inherits from QueryContainer for the same reason as the view.

Clone this wiki locally