我正在尝试使用 JPA 创建一个 objectdb。下面的代码是我所做的,但不确定我是否做得正确。实体是学生,属性是名字,姓氏等。有人知道我是否将其设置为正确的,是否错误?
package Student;
import java.io.Serializable;
import java.sql.Date;
import javax.persistence.*;
@Entity
public class students implements Serializable {
private static final long serialVersionUID = 1L;
@studentid @GeneratedValue
private long id;
}
public class studentdetails {
int studentid;
String firstname;
String surname;
char gender;
Date dob;
String address1;
String address2;
String address3;
char postcode;
int phonenumber;
int courseid;
}