📄 customer.java
字号:
package entity;
import javax.persistence.*;
/**
* The customer class is annotated to customize its mapping.
* It uses @Table, @Column and @GeneratedValu annotations.
*
* @author Antonio Goncalves
*/
@Entity
@Table(name = "t2_customer")
public class Customer {
// ======================================
// = Attributs =
// ======================================
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(nullable = false)
private String firstname;
@Column(nullable = false, length = 30)
private String lastname;
@Column(length = 15)
private String telephone;
@Column(name = "e_mail")
private String email;
private Integer age;
// ======================================
// = Constructors =
// ======================================
public Customer() {
}
public Customer(String firstname, String lastname, String telephone, String email, Integer age) {
this.firstname = firstname;
this.lastname = lastname;
this.telephone = telephone;
this.email = email;
this.age = age;
}
// ======================================
// = Getters & Setters =
// ======================================
public Long getId() {
return 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 + -