Last active
August 20, 2023 14:40
-
-
Save azizkale/e5f2a950989092cb57f1ceccc794ce97 to your computer and use it in GitHub Desktop.
the article - How to implement Hibernate in Spring Boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kale.hibernatetutorial.model; | |
import jakarta.persistence.*; | |
@Entity | |
@Table(name="employee") | |
public class Employee { | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
@Column | |
private Integer id; | |
@Column | |
private String name; | |
@Column | |
private String department; | |
@Column | |
private String gender; | |
public Integer getId() { | |
return id; | |
} | |
public String getName() { | |
return name; | |
} | |
public String getDepartment() { | |
return department; | |
} | |
public String getGender() { | |
return gender; | |
} | |
public void setId(Integer id) { | |
this.id = id; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public void setDepartment(String department) { | |
this.department = department; | |
} | |
public void setGender(String gender) { | |
this.gender = gender; | |
} | |
@Override | |
public String toString() { | |
return "Employee{" + | |
"id=" + id + | |
", name='" + name + '\'' + | |
", department='" + department + '\'' + | |
", gender='" + gender + '\'' + | |
'}'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment