ch.inftec.ju.testing.db.data.entity.Player Maven / Gradle / Ivy
package ch.inftec.ju.testing.db.data.entity;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import ch.inftec.ju.db.AbstractPersistenceObject;
@Entity
public class Player extends AbstractPersistenceObject {
@Id
@GeneratedValue
private Long id;
private String firstName;
private String lastName;
@Temporal(TemporalType.DATE)
private Date birthDate;
@ManyToMany(mappedBy="players")
private Set teams = new HashSet<>();
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 Date getBirthDate() {
return birthDate;
}
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public Set getTeams() {
return teams;
}
}