RE: ERXMutableArray fields in Entity Modeler
RE: ERXMutableArray fields in Entity Modeler
- Subject: RE: ERXMutableArray fields in Entity Modeler
- From: email@hidden
- Date: Thu, 17 Apr 2008 13:35:47 -0700
-------- Original Message --------
Subject: ERXMutableArray fields in Entity Modeler
From: Jeff Schmitz <email@hidden>
Date: Thu, April 17, 2008 4:20 am
To: WebObjects Mailing List <email@hidden.com>
Hello, I've taken Dave's SooperSeekrit Screencast project as a starting point to start playing with EO objects using the Wonder Framework.
Using Entity Modeler (with Frontbase prototypes), I've added an ERXMutableArray to one of my classes that I want to use as an array of Boolean's in my code. In this case, what do I need to put as the Value Type? Also, for the width, will it be 4 bytes X the max number of Booleans to be stored?
<snip>
I have tried just leaving these fields blank.
Then using the following code, I'm able to create a User object ok, and it shows up in my database with the Boolean array as a Blob:
Group group = Group.fetchRequiredGroup(ec, "name", "user");
Boolean [] bools = {true, false, true};
ERXMutableArray boolArray = new ERXMutableArray(bools);
User.createUser(ec, boolArray, first, last, password, newuser, group);
ec.saveChang
es();
However, when I try to a fetch from the DirectAction class as follows:
EOQualifier qual = User.USERNAME.eq(username).and(User.PASSWORD.eq(password));
User user = User.fetchRequiredUser(ERXEC.newEditingContext(), qual);
I get the following exception on the User.fetchRequiredUser line:
Apr 16 22:31:32 SooperSeekrit[49595] (ERXDatabaseContextDelegate.java:105) INFO er.transaction.adaptor.Exceptions - Database Exception occured: java.lang.ClassCastException: er.extensions.ERXMutableArray
I'm guessing it has to do with the missing fields?
Thanks,
Jeff
I might be misunderstanding your question or what you are trying to do. But I think that you are not going to be able to do this as you describe.
The picture you show is for the Properties of an attribute value. In other words, if you are returning an array of booleans, then you somehow have a to-many relationship that is returning some number of value attributes. Those value attributes are of t
ype boolean. The relationship is, in an object-oriented sense, an attribute also. But it is not a value attribute.
If you look at a relationship in a model, and look at its Properties, you will see what can be done with a relationship.
Does this make sense?
- ray
Attachment:
erxmutablearray.jpg
Description: JPEG image
_______________________________________________
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