You can change how the EntityType, ValueType, and ReferenceMode names are combined into a column names for a relational mapping both at the model level and at the individual ObjectType level.
There are a couple of Feedback requests at the end of this reply.
At the ObjectType level:
-
Select the Customer EntityType and open the Properties Window (F4). With the relational extensions turned on, you will have a 'Relational Mapping' section in the Properties Window
-
Choose 'PrimaryIdentifierName' property and pick 'ReferenceMode Name' out of the list.
-
Alternately, you can select the 'PrimaryIdentifierCustomFormat' and enter '{R}' (this will expand to {ReferenceMode} on commit). The custom format field lets you type in any values intermingled with the three available names. Examples: {E}Identifier will give you CustomerIdentifier. {R} of {E} will give you 'usernameOfCustomer' (note that the spacing and capitalization options are controlled by the Name Generation Settings branch in the 'ORM Model Browser'). Instructions are provided in the description pane of the Properties Window.
-
There are a separate set of parallel settings for how the entity is referenced, so you can call the PK column 'username' and any foreign key column referencing it 'customer'.
At the model level:
-
Click on the background of any diagram and locate the 'Relational Mapping' section in the Properties Window. (These properties are also co-located on the 'Name Generation Settings/Name Generation Defaults/Relational Names/Column Specific' node.)
-
Expand the 'DefaultPopularReferenceModeNames' section. Note that there are separate sections for the three different reference mode kinds (Popular, UnitBase, General). With an individual EntityType selection, we already know your reference mode kind, so we provide a single set of values.
-
You will see the same four properties you saw with an individual ObjectType selection.
You can refine names further using the Name Generation Settings branch. The farther you go down the branch the more specific your changes are. So, for example, any abbreviations added at the Relational Names level apply to the Column Specific settings as well, but not vice-versa.
-Matt
PS I was trying to simplify the process by only showing the CustomFormat fields on an individual ObjectType when the model default or individual choice was CustomFormat, but we ended up with a CustomFormat model-level default for popular reference modes, so you see these a lot. I was considering pulling this back in a future release to just use the CustomFormat. This makes it harder to pick the basic patterns (ValueTypeName, EntityTypeName, ReferenceModeName), but shows half the number of fields in most cases. Feedback?
PPS We've also had a request to add a DataType replacement field to add Hungarian style prefixes to the mix, which would let you do strUsername, for example. Feedback?