Re: Inheriting from EO Generated Classes
Re: Inheriting from EO Generated Classes
- Subject: Re: Inheriting from EO Generated Classes
- From: John Bruce <email@hidden>
- Date: Tue, 9 Aug 2005 15:38:44 +1000
Hi Colin,
What is the value for the class set to in your EOModel? My guess is
that is it is EOCustomer when it should be Customer.
Are you using a tool to generate the classes for you? If not you might
want to take a look at EOGenerator or WOGen. There is also some info
on this pattern (Generation Gap) in Practical WebObjects.
Cheers,
John
On 8/9/05, Colin Shreffler <email@hidden> wrote:
> I'm trying create derived (child) classes for each of my EO generated
> classes.
>
> For instance, I have an EOCustomer object that contains the java code
> generated by EOModeler. I have a class that extends this class called
> Customer. This way I can add custom code to my Customer class and generate
> the EOCustomer class whenever my model changes without having to merge my
> custom code each time.
>
> The problem I'm having is that when I try to use my Customer class in a
> fetch and display the return results in a WORepetition, the framework throws
> an error. It tries to pass the base class type (EOCustomer) rather than the
> derived type (Customer). The error is below. Is anyone else doing this
> successfully? Is there a work around?
>
> Thanks,
> Colin
>
> Error: java.lang.IllegalArgumentException: While
> trying to invoke the set method "public void
> CustomerSearch.setACustomer(Customer)" on an object of type CustomerSearch
> we received an argument of type EOCustomer. This often happens if you forget
> to use a formatter.
> Reason: While trying to invoke the set method "public void
> CustomerSearch.setACustomer(Customer)" on an object of type CustomerSearch
> we received an argument of type EOCustomer. This often happens if you forget
> to use a formatter.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden