根据https://gist.github.com/VineetReynolds/5108580,JAXB规范要求注释的元素@XmlID为String.MOXy在2.5.x版本中没有强制执行此操作.但是,
对于2.6.0版本,它似乎不再受支持了.
[Exception [EclipseLink-50016] (Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.persistence.exceptions.JAXBException
Exception Description: Property [id] has an XmlID annotation but its type is not String.]**strong text**
Run Code Online (Sandbox Code Playgroud)
这是一种想要的行为,还是一种不必要的回归?
从MOXy 2.5.x迁移时,避免此类错误的正确方法是什么?
是否@XmlJavaTypeAdapter按照本文中的描述使用JAXB编组一个长基本类型,这也影响了对象本身(及其ID)如何序列化为JSON的方式(例如,类型的id字段Long变为json字符串?