Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package com.sakadream.models;
import javax.persistence.*;
/**
* Created by Phan Ba Hai on 25/08/2017.
*/
@Entity
@Table
public class Employee {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
private int id;
@Column(length = 50, nullable = false)
private String name;
@Column(length = 50, nullable = false)
private String address;
@Column(length = 11, nullable = false)
private String phone;
@Column(nullable = false)
private int salary;
public Employee() {
}
public Employee(String name, String address, String phone, int salary) {
this.name = name;
this.address = address;
this.phone = phone;
this.salary = salary;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public int getSalary() {
return salary;
}
public void setSalary(int salary) {
this.salary = salary;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.