首先需要引入eclipselink包:
<span style="white-space:pre"> </span><dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.0</version>
</dependency>
实体类包下面需要添加jaxb.properties文件:
javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
实体类使用如下注解:
package com.chinamobile.cmss.ehub.ssb.test.entity;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.eclipse.persistence.oxm.annotations.XmlCDATA;
@XmlRootElement(name="InterBOSS")
@XmlAccessorType(XmlAccessType.FIELD)
public class UserStateR