I would like to set the domain for several columns programatically in a physical data model. I`m using an external domain model (.ddm).
Manually I can assign a domain to a column easily (see snapshot). I have already tried several ways to do it, like described in these posts:
Basically I can`t find the right EStructuralFeature or Command to attach the Domain (AtomicDomain).
Do you maybe know how I could do it?
Thank you for your help!
Pinned topic Setting Domain for Columns in a Physical Data Model
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-02-19T09:06:05Z at 2013-02-19T09:06:05Z by MarkOrmos
SystemAdmin 110000D4XK374 Posts
Re: Setting Domain for Columns in a Physical Data Model2013-02-18T19:33:08ZThis is the accepted answer. This is the accepted answer.The column's domain reference is stored in an EAnnotation of the column. Here's a simple DB2 LUW column snippet:
<columns xsi:type="LUW:LUWColumn" xmi:id="_c6WY8Hn_EeK5RLFBwmsoZw" name="Column2">
<eAnnotations xmi:id="_ffTpAHn_EeK5RLFBwmsoZw" source="ColumnDomain">
<details xmi:id="_ffTpAXn_EeK5RLFBwmsoZw" key="DomainName"
<containedType xsi:type="SQLDataTypes:DateDataType" xmi:id="_fgDP4Hn_EeK5RLFBwmsoZw" name="DATE" primitiveType="DATE"/>
MarkOrmos 270005H87520 Posts
Re: Setting Domain for Columns in a Physical Data Model2013-02-19T09:06:05ZThis is the accepted answer. This is the accepted answer.Thanks, that is it! The EAnnotation name made the difference.
Here is the working code snippet:
ICommand cmd = CommandFactory.INSTANCE.createAddAnnotationEntryCommand("add domain annotation", column, "ColumnDomain" , "DomainName", domain.getURL());
Thank you for your rapid help!