Title: oracle: how to avoid empty strings being converted to null

Hi,

Oracle treat empty strings as nulls.
That makes programation difficult, because the string
 retrieved by a get method may be null.

We have got arround the problem writing three methods for each string field:

public String getName() {
  return name == null ? "" : name;
}
public void setName(String newName) {
  name= newName;
  // or even better, to avoid useless storing: name= newName.equals("") ? null : newName;
}
public void _jdo_get_name() {
  return name;
}

And we configure mapping.xml to make jdo use "_jdo_get_name" and "setName" methods.
(_jdo_get_name is necessary. Otherwise jdo will always think the object has
 changed ("" != null), and will allways store it)

Is there any other cleaner way to acomplish this, using a
parametrized type convertor or whatsoever?
Is it possible to code a convertor and make castor use it
without modifiying castor source code?

Thank you,

-----------------------------------------------------------
German Jimenez - Ingeniero de Telecomunicacion
CIDAT - EUSKALTEL - IBERMATICA
Parque Tecnol�gico de Zamudio, ed. 205, 48170 Zamudio, Spain
Tel: +34 94 4034500 - Fax: +34 94 4310269
e-mail: [EMAIL PROTECTED] - http://www.cidat.com
-----------------------------------------------------------

Reply via email to