- user info uses foreign keys again
- user is the primary key - added trigger so user_info is automatically generated whenever a user is created/deleted
This commit is contained in:
parent
090e43e7d7
commit
cd6cd061cd
@ -1,5 +1,7 @@
|
||||
package hhn.labsw.bugageocaching.entities;
|
||||
|
||||
import org.springframework.context.annotation.Primary;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -7,25 +9,25 @@ import java.io.Serializable;
|
||||
@Table
|
||||
public class User_Info implements Serializable {
|
||||
|
||||
@OneToOne
|
||||
@Id
|
||||
private User userID;
|
||||
@OneToOne
|
||||
private User user;
|
||||
|
||||
private int rankingPointsSum;
|
||||
|
||||
@ManyToOne
|
||||
private Team teamID;
|
||||
private Team team;
|
||||
|
||||
|
||||
public User_Info() {
|
||||
}
|
||||
|
||||
public User getUserID() {
|
||||
return userID;
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUserID(User userID) {
|
||||
this.userID = userID;
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public int getRankingPointsSum() {
|
||||
@ -36,11 +38,11 @@ public class User_Info implements Serializable {
|
||||
this.rankingPointsSum = rankingPointsSum;
|
||||
}
|
||||
|
||||
public Team getTeamID() {
|
||||
return teamID;
|
||||
public Team getTeam() {
|
||||
return team;
|
||||
}
|
||||
|
||||
public void setTeamID(Team teamID) {
|
||||
this.teamID = teamID;
|
||||
public void setTeam(Team team) {
|
||||
this.team = team;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user