incubator-isis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Iain Flynn <>
Subject Re: Problem with non-support of Collections as arguments.
Date Fri, 08 Jul 2011 10:28:27 GMT
Hi Dan,

Sorry it's taken me so long to get back to you. Been moving houses and such, what fun!

I think your diagnosis seems probable, but I'm not sure how I could force an override of it,
as none of the generated classes are invoking it themselves. I can see a class in a JAR file
EMF depends on that invokes it, but I'm drawing a blank on how I can get Isis to see that
operation and ignore it.

I can manually strip code to get around the problem, but doing so involves repeated work upon
each generation of code, so much so that I wouldn't really think it practical to employ code

If you or anyone else here has some pointers, I'd really appreciate it.

Thanks for reading and thank you for the help you've given me so far,

- Iain

On 28 Jun 2011, at 17:49, dan haywood wrote:

> Hi Iain,
> What's (probably) happening here is that the addAll(int, Collection) method
> is being interpreted as an action, and Isis does not allow actions to take
> Collections as arguments (only values or entities).
> The work-around should be to mark the action using
> @org.apache.isis.annotation.Ignore.  Since this is an inherited method I
> guess you'll need to trivially override the method in order to annotate it,
> ie:
> @Ignore
> @Override
> public void addAll(int x, java.util.Collection y) {
>    super.addAll(x, y);
> }
> The above is all slightly theoretical, so let us know if it doesn't work.
> An alternative approach might be to use delegation instead of inheritance
> (ie make the generated class a delegate of a wrapper that Isis sees).
> Dan
> On 28 June 2011 17:41, Iain Flynn <> wrote:
>> Hello again.
>> Part of my MSc project involves attempting to generate domain classes from
>> a model using Emfatic and integrate those with Isis.
>> In order to do this, I have created a wrapper class that inherits from
>> Emfatic's mandatory EObject supertype while calling all the functions of
>> AbstractDomainType. I've tested this with hand-coded Isis domain classes and
>> they work fine.
>> However, implementing the generated domain classes with hand-coded
>> repositories causes Isis to throw an error, citing EMF's EList's addAll(int,
>> java.util.Collection) function (which appears to be inherited from
>> java.util.List rather than being to do with EList).
>> I've searched through my code attempting to see where this is called, with
>> no success. the EObject supertype does not appear to call it either - it
>> seems like the very appearance of such a method is causing Isis to throw an
>> exception (I added a nonsense method with a Collection argument to an
>> already-working class in an already-working project and Isis threw an
>> identical exception).
>> Does anyone have any advice?
>> Thank you for reading,
>> - Iain Flynn.

View raw message