dto 对象:
public class DTOUser implements UserDetails {
/**
*
*/
private static final long serialVersionUID = -769714837633005963L;
private Long id;
private String account;
private String password;
private String statusStr;
private UserStatus status;
private int systemAdmin;
private long operator;
private String operateTime;
private String name;
private String company;
private String email;
private String telephone;
private List<DTOAuthority> dtoAuthorities = new ArrayList<DTOAuthority>();
private List<DTOAgreement> dtoAgreements = new ArrayList<DTOAgreement>();}
实体:
@Entity
@Table(name="adt_user")
public class User {
private long id;
private String account;
private String password;
private String statusStr;
private UserStatus status;
private int systemAdmin;
private long operator;
private String operateTime;
private String name;
private String company;
private String email;
private String telephone;
private Set<Authority> authorities = new HashSet<Authority>();
private Set<Agreement> agreements = new HashSet<Agreement>();}
我使用波纹管方法将值复制到实体,但有一个例外:
java.lang.IllegalArgumentException:无法调用 com.hna.adt.orm.User.setAuthorities - 参数类型不匹配
它出什么问题了 ?
BeanUtils.copyProperties(entity, value);