In depth

From the previous chapters you already know the principle of how Jet DataModel works. But for a complete understanding, it is a good idea to study the references of all the classes that make up Jet DataModel.

Basic classes

These are the classes from which the entities - the data models of your application - must inherit.

Class Meaning of
Jet\DataModelThe most basic abstract class from which other classes inherit.

The main entities of the application must inherit from this class.
Jet\DataModel_RelatedGeneric abstract class of all subentities in any internal session to the main entity.

No subentity within an application should directly inherit from this class.
Jet\DataModel_Related_1toNAbstract class from which inherits application subentities that are bound to the parent entity by internal relations of type 1:N.
Jet\DataModel_Related_1to1Abstract class from which inherits application subentities that are bound to the parent entity by internal relations of type 1:1.

Definition - models (entities)

The following classes represent class definitions (i.e. class attributes converted into object form).

Class Meaning of
Jet\DataModel_DefinitionBasic class for working with definitions
Jet\DataModel_Definition_ModelThe base abstract class common to other classes defining entities and subentities.
Jet\DataModel_Definition_Model_MainThe class defining the main entity.
Jet\DataModel_Definition_Model_RelatedAbstract class defining all types of subentities.
Jet\DataModel_Definition_Model_Related_1to1A class defining subentity that is in a 1:1 relation to the parent.
Jet\DataModel_Definition_Model_Related_1toNClass defining a subentity that is in a 1:N relation to the parent.

Definition - properties

The following classes represent class property definitions (that is, class property attributes converted to object form).

Class Meaning of
Jet\DataModel_Definition_PropertyThe base abstract class common to all property types.
Jet\DataModel_Definition_Property_IdRepresents the type DataModel::TYPE_ID
Jet\DataModel_Definition_Property_IdAutoIncrementRepresents the DataModel::TYPE_ID_AUTOINCREMENT type
Jet\DataModel_Definition_Property_StringRepresents the DataModel::TYPE_STRING type
Jet\DataModel_Definition_Property_BoolRepresents the DataModel::TYPE_BOOL type
Jet\DataModel_Definition_Property_IntRepresents the DataModel::TYPE_INT type
Jet\DataModel_Definition_Property_FloatRepresents the DataModel::TYPE_FLOAT type
Jet\DataModel_Definition_Property_LocaleRepresents the DataModel::TYPE_LOCALE type
Jet\DataModel_Definition_Property_DateRepresents the DataModel::TYPE_DATE type
Jet\DataModel_Definition_Property_DateTimeRepresents the DataModel::TYPE_DATE_TIME type
Jet\DataModel_Definition_Property_CustomDataRepresents the DataModel::TYPE_CUSTOM_DATA type
Jet\DataModel_Definition_Property_DataModelRepresents the DataModel::TYPE_DATA_MODEL type - that is, the relation to the subentity.

Composite keys

Class Meaning of
Jet\DataModel_Definition_KeyIt represents the definition of a coposite key.

Relations

The Jet DataModel keeps together information about internal and external relations so that it can use them efficiently. Thus, the following classes are intended primarily for internal Jet DataModel needs.

Class Meaning of
Jet\DataModel_RelationsA base class whose primary purpose is to record and hold information about all known relations.
Jet\DataModel_Definition_RelationA base abstract class representing a general relation.
Jet\DataModel_Definition_Relation_InternalThe class represents the definition of an internal relation.
Jet\DataModel_Definition_Relation_ExternalThe class represents the definition of the external relation.
Jet\DataModel_Definition_Relation_Join_ItemDefines a specific link between two properties.
Jet\DataModel_Definition_Relation_Join_ConditionDefines the relationship between a property and a specific value.

ID controllers

Of course, the list of controller IDs must not be missing.

Class Meaning of
Jet\DataModel_IDControllerGeneral abstract class common for all ID controllers.
Jet\DataModel_IDController_AutoIncrementID controller operating with a numeric sequence generated by a relational database.
Jet\DataModel_IDController_UniqueStringID controller generating a random text string with a timestamp at the beginning.
Jet\DataModel_IDController_PassiveA passive ID checker that relies on the application logic to set the identification properties.

Restricted recording mode

Within loading data, it is possible to limit the upload range by rules. The rules are of course converted to an object.

Class Meaning of
Jet\DataModel_PropertyFilterRepresents the load range rules (i.e. what can be loaded) in limited upload mode.

Queries

The following classes together form the query definition. Both queries of the SELECT type, i.e. the complete definition of what the database should retrieve, and queries from which only the WHERE part is used, i.e. for DELETE and UPDATE operations.

Class Meaning of
Jet\DataModel_QueryBase class whose instance represents an abstraction of the SQL query.
Jet\DataModel_Query_SelectRepresents a list of columns to load for a SELECT query.
Jet\DataModel_Query_Select_ItemRepresents a specific column within the list for loading in a SELECT query.
Jet\DataModel_Query_Select_Item_ExpressionIt represents, for example, calling a SQL function within a list to load it in a SELECT query.
Jet\DataModel_Query_WhereRepresents the entire WHERE part of all SQL queries.
Jet\DataModel_Query_Where_ExpressionRepresents a specific part of the WHERE part of the SQL query. That is, a binding to a column (or part of SELECT), an operator and a value.
Jet\DataModel_Query_HavingRepresents the entire HAVING part of SQL queries of the SELECT type.
Jet\DataModel_Query_Having_ExpressionRepresents a specific part of the HAVING portion of the SQL query. That is, the binding to the column (or SELECT part), operator and value.
Jet\DataModel_Query_GroupByRepresents the definition of the GROUP BY part of SQL queries of the SELECT type
Jet\DataModel_Query_OrderByRepresents the definition of the ORDER BY part of SQL queries of the SELECT type
Jet\DataModel_Query_OrderBy_ItemThis is a specific element in the ORDER BY part of the SQL query.

Loading - iterators

In the context of loading, we talked about iterators for special data loading mode. Here they are:

Class Meaning of
Jet\DataModel_FetchThe base abstract class common to both iterators.
Jet\DataModel_Fetch_InstancesIterator for retrieving a list of entity instances.
Jet\DataModel_Fetch_IDsIterator for retrieving a list of entity identifiers.

Data modification

When Jet performs data storage - i.e. writes to the database (either by INSERT or UPDATE), it passes a set of data to the backend for modification in the form of instances of the following classes.

Class Meaning of
Jet\DataModel_RecordDataA class represents the entire set of data to be stored.
Jet\DataModel_RecordData_ItemA specific item in the data set to be stored.

Backend

Class Meaning of
Jet\DataModel_BackendThe base abstract class common to all backends.
Jet\DataModel_Backend_ConfigThe base abstract class defining configuration common to all backends.

Helper

The utility is designed for creating tables and updating them, or for displaying SQL queries intended for performing these operations. However, the helper is nothing more than a small facade, calling backend instances and the corresponding methods.

Class Meaning of
Jet\DataModel_HelperFacade calling backend methods designed to create and update DB tables based on definitions.
Previous chapter
Backend
Next chapter
Jet\DataModel