Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] MOXy: mapping constant values?


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

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?

View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top