cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gentry, Michael \(Contractor\)" <michael_gen...@fanniemae.com>
Subject RE: Null pointer exceptions and database null
Date Fri, 04 Aug 2006 13:40:14 GMT
I should also mention that when writing, if you encounter a NULL it should either throw an
exception or ignore the write.  The null handling is most useful when reading to present data
to the user (perhaps in a report from a query that isn't editable).


-----Original Message-----
From: Gentry, Michael (Contractor) [mailto:michael_gentry@fanniemae.com] 
Sent: Friday, August 04, 2006 9:34 AM
To: cayenne-user@incubator.apache.org
Subject: RE: Null pointer exceptions and database null


Fundamentally, no.  We'd have to "fix" to-many handling though, and make the rules understood.
 In your previous example:

foo.bar.name

Will fail in readNestedProperty() if foo->>bar is a to-many relationship.  Cayenne only
likes to-one relationships in the keypath currently.  In EOF, it will return an array of name
objects for you (which can be very useful at times).  Likewise, when writing, it would assign
the same value to all of the names.  More powerful, but the rules should be well understood
(aka, documented).

/dev/mrg


-----Original Message-----
From: oyvindharboe@gmail.com [mailto:oyvindharboe@gmail.com] On Behalf Of Øyvind Harboe
Sent: Friday, August 04, 2006 9:23 AM
To: cayenne-user@incubator.apache.org
Subject: Re: Null pointer exceptions and database null


> PS. There isn't a writeNestedProperty() though ...

Is there a fundamental reason why Cayenne couldn't handle this?

CayenneDataObject could implement some suitable semantics when it
represented a database null object.


-- 
Øyvind Harboe
http://www.zylin.com

Mime
View raw message