I have done enough sleuthing on this problem to suspect a bug in EclipseLink. To test, I made a mock class and persisted it using annotations instead of XML mappings.
If I annotate the mock class with @NoSQL(dataFormat-DataFormatType.MAPPED) -- WORKS CORRECTLY
If I annotate the mock class with @NoSQL or @NoSQL(dataFormat-DataFormatType.XML) -- ALL VALUES ARE {"#text": null}
Thus the #text-null problem does in fact arise from the DataFormatType, and I verified that the dataFormat can be set using annotations.
That leaves two possibilities: either I am not correctly making my <no-sql /> tag, or the <no-sql /> tag processor doesn't support dataFormat.
To test the first possibility I tried every conceivable variation of that tag:
<no-sql dataFormat="DataFormatType.MAPPED" />
<no-sql dataFormat="org.eclipse.persistence.nosql.annotations.DataFormatType.MAPPED" />
<no-sql dataFormat="MAPPED" />
<no-sql>
<dataFormat>DataFormatType.MAPPED</dataFormat>
</no-sql>
<no-sql>
<dataFormat>MAPPED</dataFormat>
</no-sql>
<no-sql>
<dataFormat>org.eclipse.persistence.nosql.annotations.DataFormatType.MAPPED</dataFormat>
</no-sql>
I can't be sure until I go grok the EclipseLink code but to me this smells like an incomplete implementation of XML mapping support. I would be grateful for any advice or comments.
Nicholas