You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Radhakrishnan J <ra...@tavant.com> on 2004/08/03 12:09:41 UTC

Dictating java-xml mapping

Hi,

We have a problem with XmlBeans' java-xml binding when it comes to primitive
types. XmlBeans binds 'xs:double' to java primitive double. The problem is
that the Xml document would map to a record in the database. There is an
issue at hand -

- The field retrieved from the database is obtained as a 'java.lang.Double'
instance and this instance could be null.

This mandates a null check before the Double.doubleValue() method is called.
This problem extends to some of the other built-in datatypes as well. It
would be nice if XmlBeans could be told to model the 'xs:double' as a
'java.lang.Double'. 

The other inconvenience is that if it is a Double, a null reference would
automatically translate into a 'xsi:nil=true" attribute. With the primitive
type, an explicit API has to be called.

Any ideas on a better approach ?

Thanks,
Radhakrishnan 
Extn  367

http://kwiki-infra.india.tavant.com/kwiki/



- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/