Re: ERXMutableArray fields in Entity Modeler
Re: ERXMutableArray fields in Entity Modeler
- Subject: Re: ERXMutableArray fields in Entity Modeler
- From: Chuck Hill <email@hidden>
- Date: Fri, 18 Apr 2008 10:32:27 -0700
On Apr 17, 2008, at 5:06 PM, Jeff Schmitz wrote:
On Apr 17, 2008, at 4:58 PM, Chuck Hill wrote:
On Apr 17, 2008, at 2:42 PM, Mike Schrag wrote:
Thanks for your response, and yes, I think you understand. I was
hoping to not have to create a new table with just a boolean
column along with a relationship and that I could somehow just
store an array in one of the attribute fields directly for the
same effect. I assumed that's what ERXMutableArray class was
for. If not that, then what is it usually used for?
I think it IS designed for that actually ... I would need to see
the full stack trace of that exception to be able to diagnose
further why you're getting a ClassCast, though. I believe you
also have to replace the entire array when it changes (meaning
setArrayOfBooleans(arrayOfChangedBooleans)) -- I don't think EOF
likes mutable values,
It really does not.
but maybe there's some trickery inside of Wonder specifically for
ERXMutableArray, I'm not sure. I've never used this class
though ... Maybe Anjo knows, but his weekend apparently starts on
Thursday (something about Americans being #1, and Germans not ...
I don't recall precisely ;) ).
Europeans, always so willing to trade not being #1 for having an
actual life! They should learn to emulate Canadians. We are not
#1 and we don't have lives either.
I recall badgering Anjo about use of mutable attributes once. I
think the eventually conceded that you did need to replace the
array when it changed. The comments say
an
* be used as a EOF custom value class because it can automatically
en- and
* decode an NSMutableArray as blob into a database.
So it can be used as an attribute without needing other cover
methods in your EO (e.g. serializing plists to and from a String
attribute), but is it not as trivial to use it as Jeff seems to be
planning.
So, would the recommended method (i.e simplest method, you know us
Americans, always looking to take shortcuts) be to create a new
table and a one to many relationship? My array really doesn't need
to be mutable (the size is static and known), it's just that that
was the only "array" choice given me in Entity Modeler.
That entirely depends on what you need and how you need to use it. If
you give the details, we can guide you to a solution.
Chuck
--
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