Mailing List webobjects-dev@wocommunity.org Message #114
From: Ricardo Parada <webobjects-dev@wocommunity.org>
Subject: ERXCopyable.CopyType = Nullify on to-many relationship should empty instead
Date: Thu, 25 Mar 2021 13:01:48 -0400
To: <webobjects-dev@wocommunity.org>
Hello everyone,

I like that in Wonder when you create an EO all the to-many relationships are initialized to an empty array because it means that I don’t have to worry about null checking every time I access the to-many relationship in order to avoid NullPointerExceptions. 

However, if I create my EO by copying an existing one using ERXCopyable then any to-many relationships that have ERXCopyable.CopyType set to Nullify will be set to null. 

Wouldn’t it be better to set them to an empty array? Or should we have an Emptify option?

Thanks
Ricardo Parada
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster