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!
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
2 replies Latest Post - 2013-02-19T09:06:05Z by MarkOrmos
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 PostsACCEPTED ANSWER
Re: Setting Domain for Columns in a Physical Data Model2013-02-18T19:33:08Z in response to MarkOrmosThe 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 PostsACCEPTED ANSWER
Re: Setting Domain for Columns in a Physical Data Model2013-02-19T09:06:05Z in response to MarkOrmosThanks, 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!