事实上,我正试图通过这个教程学到一些东西- https://www.youtube.com/watch?v=9SGDpanrc8U&t=2027s个
现在,我将我的新数据库与我的Sping(Java)东西连接起来. 但.我不明白为什么IJ和SQL Shell中的In Run输出显示错误的行序. The first line in column should be ID. After should go - name,email, date,age.个
实际上,它显示的是年龄、日期、身份、邮箱和姓名.我怎么才能改变它呢?求求你,救命.
来自SQL Shell的示例-
Column | Type | Collation | Nullable | Default
--------+------------------------+-----------+----------+---------
age | integer | | |
dob | date | | |
id | bigint | | not null |
email | character varying(255) | | |
name | character varying(255) | | |
Indexes:
"student_pkey" PRIMARY KEY, btree (id)
我的学生班级-
@Entity
@Table
public class Student {
@Id
@SequenceGenerator(
name = "student_sequence",
sequenceName = "student_sequence",
allocationSize = 1
)
@GeneratedValue(
strategy = GenerationType.SEQUENCE,
generator = "student_sequence"
)
private Long id;
private String name;
private String email;
private LocalDate dob;
private Integer age;
public Student() {
}
public Student(Long id, String name, String email, LocalDate dob, Integer age) {
this.id = id;
this.name = name;
this.email = email;
this.dob = dob;
this.age = age;
}
public Student(String name, String email, LocalDate dob, Integer age) {
this.name = name;
this.email = email;
this.dob = dob;
this.age = age;
}
Getters,Setters and to String
我试着把Long改成Long,其他什么都不做.我不知道怎么改变这里的线路顺序.看起来一切都很好.