db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Monroe <Greg.Mon...@dukece.com>
Subject RE: Revisited: Oracle and the empty string
Date Mon, 04 Oct 2010 13:05:20 GMT
You might handle this by defining fields which allow null to be optional in 
your XML.  E.g., tag not in XML = NULL / tag exists and is empty = "".  I think
the XML parsers can differentiate between these with some extra code.

FYI - You might want to take a look at:


This is some code I wrote a while back to support import/export of data into
one of my systems.  I've also used it as a basis for some REST services I 

> -----Original Message-----
> From: Thomas Fischer [mailto:fischer@seitenbau.net]
> Sent: Friday, October 01, 2010 4:29 PM
> To: Apache Torque Users List
> Subject: Re: Revisited: Oracle and the empty string
> 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

DukeCE Privacy Statement:
Please be advised that this e-mail and any files transmitted with
it are confidential communication or may otherwise be privileged or
confidential and are intended solely for the individual or entity
to whom they are addressed. If you are not the intended recipient
you may not rely on the contents of this email or any attachments,
and we ask that you please not read, copy or retransmit this
communication, but reply to the sender and destroy the email, its
contents, and all copies thereof immediately. Any unauthorized
dissemination, distribution or copying of this communication is
strictly prohibited.

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

View raw message