我正在使用sequel pro创建数据库表,如下所示:
https://i.imgur.com/LqIY5aV.png
https://i.imgur.com/RQLm7A2.png
我有一个users
表和一个files
表。两者之间的共同栏是username
import lombok.Data;
import javax.persistence.*;
@Entity
@Data
public class Files {
@Id
@Column(name="fileId")
private int fileId;
@JoinColumn(name="ownership")
private String username;
@Column(name="fileName")
private String fileName;
@Column(name="fileExtension")
private String fileExtension;
}
import javax.persistence.*;
import lombok.Data;
@Entity
@Data
public class Users {
@Id
@Column(name = "username")
private String user;
@Column(name = "password")
private String password;
@Column(name = "email")
private String email;
@Column(name = "premium")
private int premium;
@Column(name = "storedBytes")
private int storedBytes;
}
出现以下错误:
java.sql.SQLSyntaxErrorException: Unknown column 'files0_.file_id' in 'field list'