Normally if you extend your logical type from another base type in the model, it will automatically inherit the mapping to the Entity Data Model type from its parent. If your type does not extend any other logical type, or you just want to override the mapping to EDM type, then the following steps outline this process.
- Make sure that the module element that contains your logical type declares a prefix for the "http://www.xomega.net/edm" namespace, e.g. xmlns:edm="http://www.xomega.net/edm"
- Add a edm:type element inside of the config element of your logical type definition. In the absence of such element your logical type will just inherit the EDM type from its base type if one exists.
- Set the Type attribute by selecting the EDM type from the list or by entering your own type.
- To specify the character length facet you need to set the size attribute on the parent logical type. For all other type facets, you can add them as additional attributes, e.g. Precision or Scale, etc.
- To validate your setup find a field that uses your logical type and then generate the Entity Data Model and check the type of the corresponding properties.
Here is a sample configuration that illustrates these steps.
Code:
<module xmlns="http://www.xomega.net/omodel"
xmlns:edm="http://www.xomega.net/edm">
<types>
<type name="mileage rate" base="money">
<config>
<edm:type Type="Double" Scale="5" Precision="4"/>
</config>
</type>
</types>
</module>