Go ahead an open a bug on this. Using @NoDuplicates annotation automatically generates a property dependency (you don’t need to use @DependsOn explicitly). The dependency needs to be sensitive to context and only get generated if parent is a list.
- Konstantin
From: sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On Behalf Of Ling Hao
Sent: Monday, July 11, 2011 2:34 PM
To: Sapphire project
Subject: [sapphire-dev] @NoDuplicates question
I have a simple issue that I don't know how to address. I havea list of ICachingScheme that has a name field that should be unique which works simply with @NoDuplicates. But sometimes these ICachingSchemes are used as an ElementProperty. In these cases, I get the following error in the console:
ERROR : Invalid model path "#/SchemeName" evaluated on oracle.eclipse.tools.coherence.descriptors.cacheConfig.ICachestoreScheme.
UniqueValueValidationService contains a check for the parent to be a list, so the error came from this annotation when the parent is an ElementProperty and not a ModelElementList:
@DependsOn( "*/SchemeName" )
Unfortnately the only solution I came up with was to duplicate the classs (about 15), while the only difference between them is the @NoDuplicates annotation. Can someone suggest a better way?
Thanks,
Ling