I have a Class Model that I want to automatically transform into a Data Model using the DDL Transformation.
However, I do have multiple associations between classes that DDL transforms into one and the same FK column/operation because of the same name.
So I tried changing the Connector template to take the connectorName as the name instead if that is not empty like this:
%if connectorType != "Association"%
%endTemplate%
%if connectorDirection == "Unspecified" or connectorDirection == "Source -> Destination" or connectorDirection == "Bi-Directional"%
%if connectorName == ""%
$name = %connectorDestElemName%
%else%
$name = %CONVERT_NAME(connectorName, "Spaced", "Pascal Case")%
%endIf%
%ForeignKey(connectorGUID,connectorSourceElemGUID,connectorDestElemGUID,$name,"FK1")%
%endIf%
%if connectorDirection == "Destination -> Source" or connectorDirection == "Bi-Directional"%
%if connectorName == ""%
$name = %connectorSourceElemName%
%else%
$name = %CONVERT_NAME(connectorName, "Spaced", "Pascal Case")%
%endIf%
%ForeignKey(connectorGUID,connectorDestElemGUID,connectorSourceElemGUID,$name,"FK2")%
%endIf%
This seems to work in sofar that I get as many FK columns as I had associations (if I remember to give the associations the correct name I want for the field), but the FK relation Operations are not effected. I have not found where exactly the name for these ("FK_[Source]_[Dest]") is coming from.
I want to change this as well. Does anyone know how I can do this? This is my first try at code generation/transformation, so I sort of flying blind here...
Any help is greatly appreciated!