| From | Sent On | Attachments |
|---|---|---|
| Øyvind Harboe | Aug 20, 2008 2:46 am | |
| Andrus Adamchik | Aug 20, 2008 5:43 am | |
| Øyvind Harboe | Aug 20, 2008 6:34 am | |
| Øyvind Harboe | Aug 20, 2008 6:39 am | |
| Demetrios Kyriakis | Aug 20, 2008 6:54 am | |
| Andrus Adamchik | Aug 20, 2008 7:28 am | |
| Øyvind Harboe | Aug 20, 2008 7:38 am | |
| Demetrios Kyriakis | Aug 20, 2008 8:23 am | |
| Scott Anderson | Aug 20, 2008 9:48 am | |
| Michael Gentry | Aug 20, 2008 9:57 am | |
| Andrus Adamchik | Aug 20, 2008 10:54 am | |
| Aristedes Maniatis | Aug 20, 2008 4:59 pm | |
| Tiho Lupak | Aug 24, 2008 3:10 am | |
| Kevin Menard | Aug 24, 2008 4:00 pm | |
| Scott Anderson | Aug 27, 2008 8:37 am | |
| Aristedes Maniatis | Aug 27, 2008 5:50 pm |
| Subject: | Re: Handling of database NULL - default value column to modeler? | |
|---|---|---|
| From: | Andrus Adamchik (and...@objectstyle.org) | |
| Date: | Aug 20, 2008 10:54:05 am | |
| List: | org.apache.cayenne.user | |
If we are to bring this to Cayenne as a feature, I am very much in favor of an generic solution with the ability to define arbitrary metadata in the model. It has been mentioned in this thread already that this is a very popular request, and as usual my reply is "someday" :-/
Andrus
On Aug 20, 2008, at 4:34 PM, Øyvind Harboe wrote:
On Wed, Aug 20, 2008 at 2:44 PM, Andrus Adamchik <and...@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





