* "An Intro to Hibernate Entity Lifecycle" "An Intro to Hibernate Entity Lifecycle" by Rudi * Revision from Predrag's feedback * Another revision from Predrag's feedback * Another feedback.
35 lines
607 B
Java
35 lines
607 B
Java
package com.baeldung.hibernate.lifecycle;
|
|
|
|
import javax.persistence.*;
|
|
|
|
@Entity
|
|
@Table(name = "Football_Player")
|
|
public class FootballPlayer {
|
|
@Id
|
|
@GeneratedValue
|
|
private long id;
|
|
|
|
@Column
|
|
private String name;
|
|
|
|
public long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "FootballPlayer{" + "id=" + id + ", name='" + name + '\'' + '}';
|
|
}
|
|
} |