On 12/14/06, Tore Halset <[EMAIL PROTECTED]> wrote:
On Dec 14, 2006, at 9:11 , Øyvind Harboe wrote:

> Could I implement my own "NeverNullString" datatype where I'm thinking
> that .toString() returns the either what Cayenne java.lang.String
> returns today or e.g. "" for the case where it represents a database
> null?

Or perhaps map java.lang.CharSequence and create a NullString that
implements it. You could then create an ExtendedType (perhaps
subclass CharType) that does what you want.

If your cayenne version if from before the fix of CAY-540 you may
have to register the type for each possible concreate class, just as
I did in the JTS-example.

You may get into some problems with the wrong (default) ExtendedType
get picked before your own, but it should be fixable.

OK.

Q++: Is it a good idea to use ExtendedType to represent database null
as something else than Java null pointer?



--
Øyvind Harboe
http://www.zylin.com

Reply via email to