无法映射属性“ java.util.Set created.authorities”

时间:2018-07-29 16:59:01

标签: java jhipster

我有两个班级(域)

user{
    @JsonIgnore
    @ManyToMany
    @JoinTable(
        name = "users_authority",
        joinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "id")},
        inverseJoinColumns = {@JoinColumn(name = "authority_name", referencedColumnName = "name")})

    @BatchSize(size = 20)
    private Set<Authority> authorities = new HashSet<>();
}
unit{
    @JsonIgnore
    @ManyToOne
    @JoinColumn(name = "created_by", insertable = false, updatable = false,foreignKey = @ForeignKey(name = Constraints.fk_unit_users_created_by))
    private User created;

//我添加错误

public User getCreated() {
    return created;
}
public void setCreated(User created) {
    this.created = created;
}


}

userDTO和unitDTO 无法将属性“ java.util.Set created.authorities”映射到 “ java.util.Set创建的权限”。考虑声明/实现映射方法:  “ java.util.Set映射(java.util.Set值)”

0 个答案:

没有答案