Я только что переместил свой класс на объект, который использует расширение класса Spring Security Authentication User, и я не могу понять, какой конструктор по умолчанию мне нужно построить! Если я помещаю параметры класса, он преобразует их в static и делает hibernate неспособным отображать класс, если я ничего не ставил, он выдает ошибку!По умолчанию конструктор необоснован весной
@Entity
@Table(name="USER")
public class UserData extends User {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
int iduser;
int accountstatus;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPass(String password) {
this.password = password;
}
String username;
String password;
//Profile Data
String nomprofile;
String prenprofile;
String mailprofile;
String adressprofile;
int phoneprofile;
Date datenaissanceprofile;
char sexeuser;
String imagepath;
public UserData() {
super(username, password, authorities); //throws error
}
public UserData(String username,
String password,
boolean enabled,
boolean accountNonExpired,
boolean credentialsNonExpired,
boolean accountNonLocked,
Collection<? extends GrantedAuthority> authorities,
int iduser,
int accountstatus,
String nomprofile,
String prenprofile,
String mailprofile,
String adressprofile,
int phoneprofile,
Date datenaissanceprofile,
char sexeuser,
String imagepath) {
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
this.username = username;
this.password = password;
this.iduser = iduser;
this.accountstatus = accountstatus;
this.nomprofile = nomprofile;
this.prenprofile = prenprofile;
this.mailprofile = mailprofile;
this.adressprofile = adressprofile;
this.phoneprofile = phoneprofile;
this.datenaissanceprofile = datenaissanceprofile;
this.sexeuser = sexeuser;
this.imagepath = imagepath;
}
public int getIduser() {
return iduser;
}
public void setIduser(int iduser) {
this.iduser = iduser;
}
public int getAccountstatus() {
return accountstatus;
}
public void setAccountstatus(int accountstatus) {
this.accountstatus = accountstatus;
}
public String getNomprofile() {
return nomprofile;
}
public void setNomprofile(String nomprofile) {
this.nomprofile = nomprofile;
}
public String getPrenprofile() {
return prenprofile;
}
public void setPrenprofile(String prenprofile) {
this.prenprofile = prenprofile;
}
public String getMailprofile() {
return mailprofile;
}
public void setMailprofile(String mailprofile) {
this.mailprofile = mailprofile;
}
public String getAdressprofile() {
return adressprofile;
}
public void setAdressprofile(String adressprofile) {
this.adressprofile = adressprofile;
}
public int getPhoneprofile() {
return phoneprofile;
}
public void setPhoneprofile(int phoneprofile) {
this.phoneprofile = phoneprofile;
}
public Date getDatenaissanceprofile() {
return datenaissanceprofile;
}
public void setDatenaissanceprofile(Date datenaissanceprofile) {
this.datenaissanceprofile = datenaissanceprofile;
}
public char getSexeuser() {
return sexeuser;
}
public void setSexeuser(char sexeuser) {
this.sexeuser = sexeuser;
}
public String getImagepath() {
return imagepath;
}
public void setImagepath(String imagepath) {
this.imagepath = imagepath;
}
}
Пожалуйста, включите ваш класс 'User' или укажите полное имя класса, если оно находится в публичной библиотеке. –
Пользователь является импортом org.springframework.security.core.userdetails.User; –
какая ошибка вы получаете? –