Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 73335 invoked from network); 20 Aug 2008 13:35:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Aug 2008 13:35:38 -0000 Received: (qmail 97785 invoked by uid 500); 20 Aug 2008 13:35:36 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 97774 invoked by uid 500); 20 Aug 2008 13:35:36 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 97763 invoked by uid 99); 20 Aug 2008 13:35:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2008 06:35:36 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of oyvindharboe@gmail.com designates 64.233.170.186 as permitted sender) Received: from [64.233.170.186] (HELO rn-out-0910.google.com) (64.233.170.186) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2008 13:34:38 +0000 Received: by rn-out-0910.google.com with SMTP id m7so97037rnd.3 for ; Wed, 20 Aug 2008 06:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=YESS54LNNAJqBFogvOQpVuuyBc9Mzjfp32XJZ4W3Abw=; b=naY/LDAAZSZScsb9LcMe5f0OT1wEaT1E0WjQReJatoDfMS1ivFxfGLfLL15S9Z2jWz vKt5cd4USjUgbo9gBbO6Kf7MvSSo9JK/DLbxPAMQVTx5Ie93f+Zfnpyr1A+2Px/Mp0hb TGfsoIvmRIHRGTCx7rM+Ps96SZwzlOn6rsfHY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=yFcC1qcP7KPuJPxVeqDO3fyV5+z5zn6RyDs+SnBAL3bSJBu0OBjSkZvW5YALQv5zQN xeF7ZtSWqlBK1QZEEJo3+yq47SODAFrBZp5zLIAuZExjc/B9r+A1q/MN5KcG6XpRCioD rR2mtWBTC8PjatjhYkxRryulW3ttKJIojBv2w= Received: by 10.142.199.16 with SMTP id w16mr20676wff.268.1219239289417; Wed, 20 Aug 2008 06:34:49 -0700 (PDT) Received: by 10.142.50.21 with HTTP; Wed, 20 Aug 2008 06:34:49 -0700 (PDT) Message-ID: Date: Wed, 20 Aug 2008 15:34:49 +0200 From: "=?ISO-8859-1?Q?=D8yvind_Harboe?=" Sender: oyvindharboe@gmail.com To: user@cayenne.apache.org Subject: Re: Handling of database NULL - default value column to modeler? In-Reply-To: <9A98CE04-9FB2-4118-8D74-D038A3C346A0@objectstyle.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <9A98CE04-9FB2-4118-8D74-D038A3C346A0@objectstyle.org> X-Google-Sender-Auth: 227c817e2d787027 X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Aug 20, 2008 at 2:44 PM, Andrus Adamchik w= rote: > So this is not about syncing with DB defaults? Nope. > Then I think that's over-engineered. Would it be easier to simply overrid= e > 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. Perha= ps use a custom base class for all the CayenneDataObject subclasses and override readProperty() to handle null pointers via a lookup... --=20 =D8yvind Harboe http://www.zylin.com/zy1000.html ARM7 ARM9 XScale Cortex JTAG debugger and flash programmer