I am getting a classCastException from this when I invoke
saveChanges(). What am I doing wrong again?
public class DataEntry extends WOComponent {
private Listing listing = new Listing();
private Basic basic = new Basic();
private Specific specific = new Specific();
private ERXEC ec = new ERXEC();
public Basic aBasic = new Basic();
public Specific aSpecific = new Specific();
public DataEntry(WOContext context) {
super(context);
ec.insertObject(listing);
ec.insertObject(basic);
ec.insertObject(specific);
}
public ERXEC editingContext() {
return ec;
}
public Listing listing() {
if (listing == null) {
ec.revert();
listing = (Listing)EOUtilities.createAndInsertInstance(ec,
"Listing");
}
return listing;
}
public NSArray allSpecificTypes() {
return EOUtilities.objectsForEntityNamed(ec, "Specific");
}
public NSArray allBasicTypes() {
return EOUtilities.objectsForEntityNamed(ec, "Basic");
}
public WOComponent saveChanges() {
listing().setLastModified(new NSTimestamp());
listing().setUserId(1);
listing().addObjectToPropertyWithKey(aSpecific, "specific");
listing().addObjectToPropertyWithKey(aBasic, "basics");
ec.saveChanges();
setBasic(null);
setSpecific(null);
setListing(null);
return context().page();
}
public void setListing(Listing newListing) {
listing = newListing;
}
public Basic basicListing() {
return basic;
}
public Specific specificListing() {
return specific;
}
public void setBasic(Basic newBasic) {
basic = newBasic;
}
public void setSpecific(Specific newSpecific) {
specific = newSpecific;
}
}
this is the first part of the stack trace for this error:
java.lang.ClassCastException:
com.webobjects.foundation.NSMutableArray
_Listing.java
231
specific
com.findthemlistings.eo
NativeMethodAccessorImpl.java
NA
invoke0
sun.reflect
NativeMethodAccessorImpl.java
39
invoke
sun.reflect
DelegatingMethodAccessorImpl.java
25
invoke
sun.reflect
Method.java
585
invoke
java.lang.reflect
NSKeyValueCoding.java
684
methodValue
com.webobjects.foundation
NSKeyValueCoding.java
1160
valueInObject
com.webobjects.foundation
EOCustomObject.java
1559
valueForKey
com.webobjects.eocontrol
EOCustomObject.java
774
eoDescription
com.webobjects.eocontrol
EOCustomObject.java
239
toString
com.webobjects.eocontrol
NSArray.java
920
toString
com.webobjects.foundation
String.java
2615
valueOf
java.lang
StringBuilder.java
116
append
java.lang
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40isd.uni-stuttgart.de
This email sent to email@hidden