users@jaxb.java.net

Re: IdentifiableObject cast for IDREF check throwing null

From: Ed Mooney <Ed.Mooney_at_sun.com>
Date: Tue, 24 Jun 2003 13:41:55 -0400

Hi Sean,

I'd expect the IMXLoanID attribute not to appear if you're building the
document in memory and never made a call to setIMXLoanID. Otherwise, I'd
need more details.

Regards,
--
Ed Mooney         |Sun Microsystems, Inc.|Time flies like
Java Web Services |UBUR02-201            |an arrow, but
Ed.Mooney_at_Sun.COM |1 Network Drive       |fruit flies like
781-442-0459      |Burlington, MA  01803 |a banana. Groucho
Sean O'Leary wrote:
> I was wondering if you could help me with a little problem I am having with JAXB and IDREF fields. I am filling an ID attribute value way before filling an IDREF attribute value in my content tree. Then when I marshall I just get NULL for the following bit of code that is in the generated classes:
>
> context.text(context.onIDREF(((com.sun.xml.bind.marshaller.IdentifiableObject)((java.lang.Object) _IMXLoanID))));
>
> I narrowed it down a bit and _IMXLoanID has a value but when it casts to IdentifiableObject it gives a null. Does anyone know what is wrong with this bit of code? FYI, _IMXLoanID is just an attribute of the class and it is a String object.
>
> Help!