我正在使用带有 orcale 12c 和 java 9 的休眠 5 当我执行此代码错误时发生休眠无法执行语句
我在 Hibernate 编写了简单的程序并捕获了一堆异常。
我无法找出到底出了什么问题。
我有三个班级——学生、主班和hibernate.cfg、xml。
这是非常简单的休眠代码,只涉及一个类,即学生类
学生.JAVA
package hibernate.demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
//@Table(name="student")
public class Student {
@Id
// @GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="id")
private int id;
@Column(name="first_Name")
private String firstName;
@Column(name="last_Name")
private String lastName;
@Column(name="email")
private String email;
public Student() {
}
public Student(String firstName, String lastName, String email) {
super();
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return "Student [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", email=" + email + "]";
}
}
繁华开满天机
慕哥9229398
Qyouu
相关分类