Part II: define ORM data types
In this part of the serial about a support implementation for an own ORM into ORM Designer we are going to show you how to configure ORM framework data types. Each ORM uses its own types that reflect the framework orientation and usage. That’s why ORM Designer offers the possibility of all types setting.
Here you can find an article about preliminary settings and configuration files creating.
An example of several data types settings for our AtomixORM:
If you have defined ORM data types as shown in our XML example, during an entity editing you should see following data types in field editor:
For the data type defining use an element orm-data-type. Here is a description of all its attributes:
- name This is the only one attribute which is required. It includes a data type name.
- unified-name By this attribute it is possible to enumerate the data types that are transformed into a specific ORM data type during an import from external applications or another sources. For example when is a model imported from a database. All the columns with datatype TEXT,LONGVARCHAR,VARCHAR and CHAR will be transformed to ORM data type string. All the datatypes in “unified-name” attribute have to start with char @.
- primary-key-data-type By this attribute is defined which of datatypes is used as datatype for automatically created primary keys. If more datatypes have this attribute, the first found attribute will be used.
- has-enum-values By this attribute are marked the datatypes of enumeration type. Currently using of this attribute has no influence on any ORM Designer functionality. We recommend to fill this attribute because it can be used in future ORM Designer versions with new functions implementation.
- If you have any question about this or following chapter, don’t hesitate and ask us directly here on the blog or you can contact us at [email protected]