.. ******************************************************************************* * MetaFactory.io R2 * Technical Documentation * * File name : ProRef_Maps.rst * Created by : Marnix Bochove (original text) * Updated by : Niels de Nies * * MetaFactory BV Amsterdam ******************************************************************************* .. include:: /inline-images.txt .. include:: /metadata_include.txt Maps ==== is a sub element of . It is a collection of elements. A map element is used to alter the build-in type sets javaTypes or hibernateTypes mapping. The javaTypes is used by MetaFactory to map model object attribute types to actual Java types. The map functionality can also be used to create a custom set that maps the javaTypes to an equivalent type of a different language, such as typescript. One could use the combination of the standard javaTypes mappings and custom types for instance to create an application with Angular 2 front end (using TypeScript) with a Java-based back end. MetaFactory has default type mappings for JavaTypes but you can (partially) override those using this element. .. rubric:: Syntax .. code-block:: xml :caption: syntax :name: PR-Maps :linenos: :emphasize-lines: 5-7 ... ... .. rubric:: Available maps MetaFactory contains 2 hardcoded maps: - javaTypes and - hibernateTypes |Loupe M| For details see: :ref:`Data type mappings ` .. rubric:: Attributes There are no attributes for . .. rubric:: Sub elements .. list-table:: ** sub elements** :widths: 15 70 15 :header-rows: 1 * - Name - Details - Number * - map - map is used to customize a javatype mapping. - 1 .. rubric:: Sub element **map** (|eye s| singular) .. list-table:: ** attributes** :widths: 15 85 :header-rows: 1 :class: tight-table * - Name - Details * - name - Name of the map. Mandatory .. list-table:: ** sub elements>** :widths: 15 30 15 15 :header-rows: 1 :class: tight-table * - Name - Details - Attributes - Number * - entry - |Question S| - key, Required value, Required - 0 or more Examples ~~~~~~~~ :numref:`PR-maps-01` is an example of a project file with a mapping in order to override the mapping for Date with org.joda.time.LocalDate instead of java.util.Date. .. code-block:: xml :caption: in project file :name: PR-maps-01 :linenos: :emphasize-lines: 5-12 ... ... In the code_instruction a map can be used by applying the MetaFactory expression language (a simple version of el). The syntax is: .. code-block:: ${map(mapName, key)} .. rubric:: Example .. code-block:: ${map(javaTypes, big_decimal)} which returns java.math.BigDecimal