Re: expected a ___ but received a com.webobjects.eocontrol.EOGenericRecord
Re: expected a ___ but received a com.webobjects.eocontrol.EOGenericRecord
- Subject: Re: expected a ___ but received a com.webobjects.eocontrol.EOGenericRecord
- From: Chuck Hill <email@hidden>
- Date: Sat, 18 Oct 2008 17:47:43 -0700
Is the class name in the model com.operawarwick.venice.Company or just
Company? It should be the former.
Chuck
On Oct 18, 2008, at 1:32 PM, Thomas Worrall wrote:
Hi! You must all be getting mighty sick of me by now :(
This used to work, but something changed. I think I have upgraded
Wonder in the meantime, so it may be an upgrade problem.
In my Main component, I have this line:
<wo:WORepetition list="$companies" item="$companyEnumerator">One
Company</wo:WORepetition>
Associated Java code:
public class Main extends ERXComponent {
public Company companyEnumerator;
public Main(WOContext context) {
super(context);
}
public NSArray<Company> companies() {
return
EOUtilities.objectsForEntityNamed(session().defaultEditingContext(),
"Company");
}
}
The entity Company has a class name Company, and I generated the
Java files for it using Velocity, using the _WonderEntity.java
templates.
The error I get is this:
Error:
java.lang.IllegalArgumentException: While trying to set the field
"companyEnumerator" on an object of type
com.operawarwick.venice.components.Main we expected a
com.operawarwick.venice.Company but received a
com.webobjects.eocontrol.EOGenericRecord with a value of {values =
{shows = ")>"; name = "Name of company"; agents = ")>"; }; this =
""; }. This often happens if you forget to use a formatter.
Reason:
While trying to set the field "companyEnumerator" on an object of
type com.operawarwick.venice.components.Main we expected a
com.operawarwick.venice.Company but received a
com.webobjects.eocontrol.EOGenericRecord with a value of {values =
{shows = "<com.webobjects.eocontrol._EOCheapCopyMutableArray 37d115
(<EOAccessArrayFaultHandler shows _EOIntegralKeyGlobalID[Company
(java.lang.Integer)1]>)>"; name = "Name of company"; agents =
"<com.webobjects.eocontrol._EOCheapCopyMutableArray c52ffa
(<EOAccessArrayFaultHandler agents _EOIntegralKeyGlobalID[Company
(java.lang.Integer)1]>)>"; }; this =
"<com.webobjects.eocontrol.EOGenericRecord ad6c35
_EOIntegralKeyGlobalID[Company (java.lang.Integer)1]>"; }. This
often happens if you forget to use a formatter.
As I say, it used to work. I did some stuff to the rest of the app,
and then came back to this part, and it no longer worked. I've just
created a new project and put in just this code, and it still does
it. It could be something to do with my EOModel file (attached), but
I don't see what -- it has the correct class name listed. It's as if
the EOUtilities method is returning everything as type
EOGenericRecord despite what is written in the EOModel.
Thomas
<venice.eomodeld>
_______________________________________________
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
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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