cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Øyvind Harboe" <oyvind.har...@zylin.com>
Subject Re: Handling of database NULL - default value column to modeler?
Date Wed, 20 Aug 2008 13:34:49 GMT
On Wed, Aug 20, 2008 at 2:44 PM, Andrus Adamchik <andrus@objectstyle.org> wrote:
> So this is not about syncing with DB defaults?

Nope.

> Then I think that's over-engineered. Would it be easier to simply override
> needed getters per entity class and do "return super is null ? defaultVal :
> super", without changing Cayenne core?

That of course gives the user no user interface to
browse through the model to figure out how defaults are handled +
scatters boilerplate code all over the subclasses.

Perhaps there is some other way to achieve this?

The crucial bit is to be able to tabulate handling of default values. Perhaps
use a custom base class for all the CayenneDataObject subclasses and
override readProperty() to handle null pointers via a lookup...

-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer

Mime
View raw message