Nothing built into Cayenne. A few options - return defaults by overriding accessors for the properties at hand. Or more low level - a custom org.apache.cayenne.access.jdbc.SelectAction that creates a wrapper around the standard ResultIterator that would check each returned row and fill in the defaults.
If you can think how to handle the later case in a generic fashion in Cayenne, we'd welcome a patch against 3.1 (trunk). Andrus On Jul 6, 2011, at 12:26 PM, Hans Pikkemaat wrote: > PS: I'm using cayenne 2.0.4 > > On 6/7/11 11:20 AM, Hans Pikkemaat wrote: >> Hi, >> >> I'm using a legacy database with old data. There are null values in fields >> which have a specific meaning. >> The legacy systems handle this in the code. In my new code I do not want to >> add such hardcoded handling. >> >> I cannot update the fields because it will break old systems. >> >> My question: is there a generic mechanism where I can tell cayenne to >> provide default values for fields which >> have null values when I'm running queries. >> >> tx >> >> Hans >> > >
