Refer to object classes and object class properties
The name of the database table is specified by the Tech Name attribute of the object class. The names of the columns in the table are specified by the Tech Name attribute of the object class properties of the respective object class. For most standard Alfabet object classes and properties, the Tech Name is identical to the Name attribute of the object class or property. All Tech Name attributes are written in upper case letters.
If the technical name derived from the object class name conflicts with keywords reserved for the relational database management system (RDBMS ) of the database server, the Tech Name will be written with a prefix "T_" for tables of object classes and a prefix "A_" for columns representing attributes.
The following query targets the database table storing organizations. While the Name of the object class is Organization , the TechName is ORGAUNIT:
The native SQL must use the Tech Name to find organizations:
- SELECT org.REFSTR, org.NAME
- FROM ORGAUNIT org
Each object class property has an attribute Property Type that specifies how data must be defined (for example, as a string, date, integer, reference, etc.). The Property Type determines how the data is stored in the database tables:
| Property type | Stored as: |
|---|---|
| Boolean | bit |
| Date | datetime |
| DateTime | datetime |
| Integer | int |
| Real | float |
| RealArray | nvarchar(max) |
| Reference | varchar(20) |
| ReferenceArray | nvarchar(max) |
| String | varchar($Size$) |
| StringArray | nvarchar(max) |
| Text | nvarchar(max) |
| Time | datetime |
| Url | nvarchar(max) |
There are a number a characteristics that are relevant for query building:
- The REFSTR object class property is a unique internal object ID that explicitly identifies each object in the database and is used for references between objects in the database and for identification of the object by technical processes. In database columns of object class properties of the data type Reference , the REFSTR of the referenced object is stored as the data type varchar(20).
The REFSTR property shall not be used in queries to identify single objects. Instead, it is recommended that you use unique key attributes such as an object's name and version. If you archive a database and restore the archive in another database, the REFSTR property of single objects may change. This is not affecting references between objects. References are automatically adapted to the new REFSTR scheme.
-
Object class properties of the type ReferenceArray are handled in two different ways depending on the setting of the attribute Reference Support of the object class property:
- If ReferenceSupport is set to true , the relations specified by the property are stored in the RELATIONS table. No database column is available for the property in the table of the object class itself. The RELATIONS table specifies the relation in the following database columns:
- FROMREF: The REFSTR value of the object that is referencing another object.
- PROPERTY: The property of the object specified with FROMREF that defines the relation between the objects.
- TOREF: The REFSTR value of the referenced object.
- If Reference Support is set to false , the relations are stored directly in the database table of the object as a string. The REFSTR of all referenced objects are listed whitespace separated.
- If ReferenceSupport is set to true , the relations specified by the property are stored in the RELATIONS table. No database column is available for the property in the table of the object class itself. The RELATIONS table specifies the relation in the following database columns:
- Object class properties of the data type Reference or ReferenceArray can target only objects in a defined subset of object classes in the Alfabet meta-model. This subset is defined by the Type Info attribute of the object class property defining the reference or reference array. The attribute Type Info of the object class property specifies the name of the allowed target object classes as a comma-separated list.
- Values for object class properties of the data type REAL are stored as database data type FLOAT in the Alfabet database. Independent from the database storage type, real values can be added for display in configured reports based on native SQL queries using the data types real , float(53) and float(24).
- Object class properties of the data type URL are stored as a title text and the URL divided by a line break written as character code 13 followed by character code 10. If no title is provided, only the URL is stored.
- TitleCHAR(13)CHAR(10)http://target.com
- Integer enumerations can be defined for numeric values to convert them to numbers on the user interface. These integer enumerations are not available for query building. The native SQL query can only read the numerical values.
- Boolean values are stored as 1 for true and 0 for false. Boolean object class properties which are not mandatory will be NULL if not set.