Spring Hat Mongo Data Find存储库在出现仇恨事件时返回不支持的操作错误

时间:2019-01-30 14:59:00

标签: java spring spring-boot spring-data spring-hateoas

它在存储库查找方法上返回错误 。 java.lang.UnsupportedOperationException:没有访问者来设置属性@ javax.xml.bind.annotation.XmlElement(namespace = {http://www.w3.org/2005/Atom,name = link,type = class javax.xml.bind.annotation.XmlElement $ DEFAULT,defaultValue =,必填= false,nillable = false)@ com.fasterxml.jackson.annotation.Json

存储库

public interface CommentRepository extends CrudRepository<Comment, String> { 
Iterable<Comment> findBySectionIdAndCommentableTypeAndCommentableIdAndDeleted(final String sectionId,
        final String commentableType, final String commentableId, final boolean deleted);

评论模型

@ApiModel(description = "Comment")
@Document(collection = "comment")
@JsonInclude(Include.NON_NULL)
@Relation(value = "comment", collectionRelation = "comments")
public class Comment extends ResourceSupport implements Serializable, 
UserIdentifiable {

private static final long serialVersionUID = 116036486931198760L;

/** The id of the comment. */
@Id
@ApiModelProperty(readOnly = true)
private String commentId;

@NotEmpty
@ApiModelProperty(required = true)
private String sectionId;

/** The type of the comment applicable element. */
@NotEmpty
@ApiModelProperty(required = true)
private String commentableType;

在将Spring Boot版本升级到2.1.2之后发生

0 个答案:

没有答案