|
Re: EMF Validation, [message #1252329 is a reply to message #1251992] |
Fri, 21 February 2014 05:21 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Neil,
Comments below.
On 20/02/2014 9:35 PM, Neil Mackenzie wrote:
>
> Hello,
> I am tryting to write a custom validation for my EMF model.
> I have a class called Table and a class Column. Tables can contain
> many Columns.
> I would like to set a validation where a column name must be prepended
> by the name of the table (e.g. for a table called Book, the contained
> columns must have names Book.*, e.g. "Book.Author", "Book.Title")
> I can add a very simple custom validation on my Column class in EMF,
> but I don't know how to reference the parent/containing class Table in
> my validation code.
You should consider defining a reference "table" of type "Table" in
"Column" and making the Table.columns reference its opposite. Then you
have a getTable method you can use. Failing that column.eContainer will
typically be the Table, unless the Column is contained elsewhere.
> Any help would be appreciated.
> Thanks,
> Neil
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03348 seconds