我正在使用Spring 3 MVC框架和Google App Engine Datanucleus JPA构建应用程序, 我的实体类看起来像这样:
@Entity
@XmlRootElement
public class Incident {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
private String incidentId;
@Persistent
@Extension(vendorName = "datanucleus", key = "gae.pk-id", value = "true")
private Long keyId;
private List<String> requests;
@XmlElement(name="sr")
public List<String> getRequests() {
return requests;
}
public void setRequests(List<String> requests) {
this.requests = requests;
}
[...]
}
我正在尝试使用jaxb2Marshalleg r -
将其发送到其他应用程序但是当我有@XmlElement(name="sr")
注释时,我得到了:
2012-08-07 10:02:17 org.datanucleus.metadata.AbstractClassMetaData determineObjectIdClass
SEVERE: Class pl.km.smartcity.datastore.Incident has application-identity and no objectid-class specified yet has 0 primary key fields.
Unable to use SingleFieldIdentity.
Class pl.km.smartcity.datastore.Incident has application-identity and no objectid-class specified yet has 0 primary key fields. Unable to use SingleFieldIdentity.
当我删除这个注释时,它可以工作,但当我传递对象时,我的请求列表当然没有传递。