Switch to: V10V9V8V7V6V5

Valentina Database Model

The Valentina Database Model (VDM) is an extension of the object-relational database model. This means that Valentina supports the relational database model but extends it with both unique and object-based features.

A key advantage of object-relational databases is that it allows you to build databases using the relational model, then add object features when you are ready, much like the migration from programming in C to C++ (or C#).

Field RecID

All Valentina tables have a Field with the name RecID.

The field RecID identifies a record in the scope of a Table. The Value of this field actually is the physical address of a record. The first physical record has a RecID equal to 1. The size of this field is 4 bytes, its type is ULONG. Therefore, in a Table we can have up to 4 billions of records. The beauty of this field is that its values are not stored on the HDD.

The RecID value of a record is never changed during its life because Valentina never moves records on deletion, but marks them as deleted and later reuses the space of deleted records. Therefore, the RecID field in many cases can be used as an identifier of the record, so developers do not have to care about Key Fields of Tables.

Notes: The RecID field is not directly analog to a Key Field based on an integer field, because the values of a RecID field can be reused. If your tasks do not allow such behavior then you should define an ID field in your Table(s) and a Foreign Key in the child Table(s).

Field OID

Each Table of Valentina always have field with name OID.

The Field OID identifies a record in the scope of the database. The Value of OID field is build as combination of TableID + RecID. The size of this field is 8 bytes, its type is ULLONG. Values of this field also are not stored on the HDD.

Notes: The OID field is the feature of OO DBMS from ODMG standard.

It is easy to see that OID field have the same behavior as RecID field. Value of OID is never changed during life of a record. Values of OID can be reused for deleted records.

Notes:

  • You can access fields RecID and OID only by name.
  • The STAR of SQL query “SELECT * FROM T” do not select RecID and OID fields. If you want see them (and all other Table Methods) you should specify their name explicitly or to use Valentina SQL extension “STAR STAR”:
 SELECT RecID, *  FROM T 
 SELECT ** FROM T

Abstraction "Link"

Valentina Database Model starting from 2.0 version introduces a new abstraction VLink.

Working with Tables, a database designer often set links between 2 or more Tables. Valentina extends the relational model by adding a new abstraction Link.

See details here...