cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: Null pointer exceptions and database null
Date Thu, 03 Aug 2006 21:14:31 GMT
For JSF, it updates values even if the values haven't changed.   So I
check for that condition and if so, I don't actually update anything.

The safety issue is that DataObjects are only equal if it's the same
object in memory.  So assigning another seemingly identical object
would sneak through.

I eventually (last week) wrote a new equals() method for my
BaseDataObject class that makes DataObjects equal if their ObjectId
value is equal.   I'm hoping that will do what I want, but I'm a bit
nervous about changing DataObject equality.


On 8/3/06, Øyvind Harboe <oyvind.harboe@zylin.com> wrote:
> Super!
>
> >         // TODO: needed for JSF
> >         Object oldValue = readProperty(propName);
> >         if (oldValue == value)
> >         {
> >             // NOOP
> >             return;
> >         }
> >         if (null != oldValue)
> >         {
> >             if (oldValue.equals(value))
> >             {
> >                 // NOOP
> >                 // IMPLEMENT: not sure if this is safe!
>
> What does this comment mean?
>
>
>
> --
> Øyvind Harboe
> http://www.zylin.com
>

Mime
View raw message