Hi everyone.
I'm having a hard time trying to add xsi:nil=true to some properties in
the generated instances.
I have read that doing that was as simple as setting the property to null.
Let's consider that I have a DataObjectBase object called "builtObject".
My property is called "test" and is set to nillable in my XSD.
If I write builtObject.set("test", null), the property is not set as
expected : if I then call builtObject.isSet("test"), I get 'false' where
as I should get true as stated in the specification (test=null +
isSet(test) = true ==> xsi:nil). Logically, the returned XML simply
ignores the property while I need it to be present and set to null.
I jumped into the source code of SDO and I got to these lines:
public static void set(DataObject dataObject, String path, Object value)
{
Property property = dataObject.getType().getProperty(path);
if (property != null)
{
dataObject.set(property, value);
}
else
{
Accessor.create((EObject)dataObject, path,
value).setAndRecyle(value);
}
}
I do not really understand what is the Accessor used for.
--
*Jawad, * pour l'équipe CitizenPlace
Tél : +33 9 52 31 26 45
Mobile : +33 6 20 08 16 13
E-mail : [email protected] <mailto:[email protected]>