Byron Foster <[EMAIL PROTECTED]> writes:

> Here is a patch that fixes bug #3496:
>     http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3496
>
> In general ObjectKeys are no longer stored within a Torque OM object
> with a value property of null, but are rather converted to null so
> that the associated get call always return null for when an object is
> not associated or defined.  I think this is intuitive behavior as
> described in the bug.   This is consistent with what the current get
> property method expects for how ObjectKey fields will be handled.
>
> I removed code that previously did just the inverse so that when a
> null value was passed to the set method a new ObjectKey was created
> and set given a value of null. I did not find where this is necessary
> or desirable, certainly since it breaks the associated get method.
>
> This will change behavior slightly but I dont think it will affect
> current code that calls Torque OM objects. Before the new changes if a
> foreign key field is not required, then selecting an object out of the
> database that does not have an associated object for the given foreign
> key would create an ObjectKey with a null value property.  With this
> patch this same case simply returns null.  But like the bug states
> people should be testing this case currently with:
>
> if (getXXX() != null || getXXX().getValue() != null)

Thanks Byron, applied to jakarta-turbine-torque, and closed the bug.
Jason will be backporting to the Turbine 2.x module shortly.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to