db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject Re: Revisited: Oracle and the empty string
Date Fri, 01 Oct 2010 20:29:22 GMT
Thomas Vandahl <tv@apache.org> wrote:
> On 01.10.10 21:47, Thomas Fischer wrote:
> > In my experience, it is no problem if you keep that fact in mind. It
just
> > makes the code non-portable to another database (you only query for not
> > null and know it's also not empty in oracle, but not dor other
databases).
> > Is it a problem for yaou if "" and null get mapped to the same value ?
>
> Unfortunately it is. The XML processing is different for these cases.
> Suggestions are welcome. Patch it in the template to some strange value?
> Other ideas?

I do not understand the problem well enough (perhaps you can provide a
little code example ?) but what you could do is to use the first characte
of the String in the database as a flag: "N" for null and "O" for other
(not null). You can overwrite the setters and getters such that they add
and remove the flag automatically.

You could use the template override mechanism in Torque4 to do this with
minimum impact. There is a similar example in the torque4 test project (use
the overrideConfigDir to override certain template settings). If you look
at it and there is not enough documentation just open a jira issue.

    Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message