| [news.eclipse.tools.emf] Re: Complex EMF Query for a "Simple Query" |
Hello Christian,
Thanks a lot.
I managed to reduce some of my condition objects based on your input.
The code now looks like this (and as you said - simple)
EObjectCondition authorCondition = new EObjectCondition() {
@Override
public boolean isSatisfied(EObject object) {
//Removed reflection for simplicity
if (object instanceof Writer)
if (((Writer) object).getBooks().size() > 10)
return true;
return false;
}
};
SELECT select = new SELECT(new FROM(selectedEObjects), new WHERE(
authorCondition));
I didn't extend EObjectReferenceValueCondition as my check was not on an EReference of the context, but a computation on my contextual object itself (size of Elist containing books).
I have different question now about EMF model query solutions available. I will post it as a separate thread. Thanks Nirmal