📄 customer.java
字号:
package entity;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
* This code illustrates the minimum required to have Customer persistent
* object with JPA. You basically need to identify it as beeing an entity
* (using @Entity annotation) and an attribut has to be an identifier (@Id)
*
* @author Antonio Goncalves
*/
@Entity
public class Customer {
// ======================================
// = Attributs =
// ======================================
@Id
private Long id;
private String firstname;
private String lastname;
private String telephone;
private String email;
private Integer age;
// ======================================
// = Constructors =
// ======================================
public Customer() {
}
public Customer(Long id, String firstname, String lastname, String telephone, String email, Integer age) {
this.id = id;
this.firstname = firstname;
this.lastname = lastname;
this.telephone = telephone;
this.email = email;
this.age = age;
}
// ======================================
// = Getters & Setters =
// ======================================
public Long getId() {
return id;
}
public void setId(Long 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 getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -