cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tore Halset <hal...@pvv.ntnu.no>
Subject Re: Represesntation of database NULL as something else than Java null pointer
Date Thu, 14 Dec 2006 12:50:40 GMT
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.

  - Tore.


Mime
View raw message