|[eclipselink-users] MOXy: mapping constant values?|
Hi, The situation I have is that there are some constant values that I want to appear in my XML output document (like application=Foo). I don't want this value to be affected by unmarshalling. How does one map this kind of "constant"? After playing around with EclipseLink, it looks like even though this value is supposed to be a constant, I need to create a variable for it in my domain object in order to create a mapping to the proper XPath. But then what should I do? I don't want this variable's value to change by unmarshalling. I can write an afterLoad method to reset the variable back to its original value. That way when I marshall the object, the correct value will be output in the XML. But is there a better way to do this? Does EclipseLink support one-way mappings or marshalling constants? Thanks! --Polly -- View this message in context: http://www.nabble.com/MOXy%3A-mapping-constant-values--tp17763195p17763195.html Sent from the EclipseLink - Users mailing list archive at Nabble.com.
Back to the top