My point is that a NullPointer Exception should not be thrown some
other cayenne exception should be thrown. A null pointer exception
implies that the deleteObject call is not handling a null value, and
is instead strying to use the object witout checking or trapping.
-- Joshua T. Pyle Go has always existed.On Wed, 12 Jan 2005 20:29:48 -0500, Mike Kienenberger <mkienen..laska.net> wrote: > Joshua Pyle <joshua.t.pyl..mail.com> wrote: > > I passed a null value to the deleteObject call of DataContext and got > > the following. > > > > CauseCd causeCdToDelete = null; > > this.dbContext.deleteObject(causeCdToDelete); > > > > Gave me..... > > > > java.lang.NullPointerException > > at > org.objectstyle.cayenne.access.DataContext.deleteObject(DataContext.java:1008) > > at > com.ray.rms.it.esolutions.mla.Model.test.deleteCauseCdExample(test.java:206) > > at com.ray.rms.it.esolutions.mla.Model.test.main(test.java:41) > > > > Its an easy work around but I was curious if others have seen this. > > Intuitively I would think that deleteObject would just ignore a null > > value. > > There's no valid use case to delete a null object. > Thus, if you're doing it, it's an error. So it throws a > NullPointerException. > > -Mike >
This archive was generated by hypermail 2.0.0 : Thu Jan 13 2005 - 13:17:32 EST