- 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;
|
package hhn.labsw.bugageocaching.entities;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@ -7,25 +9,25 @@ import java.io.Serializable;
|
|||||||
@Table
|
@Table
|
||||||
public class User_Info implements Serializable {
|
public class User_Info implements Serializable {
|
||||||
|
|
||||||
@OneToOne
|
|
||||||
@Id
|
@Id
|
||||||
private User userID;
|
@OneToOne
|
||||||
|
private User user;
|
||||||
|
|
||||||
private int rankingPointsSum;
|
private int rankingPointsSum;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Team teamID;
|
private Team team;
|
||||||
|
|
||||||
|
|
||||||
public User_Info() {
|
public User_Info() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public User getUserID() {
|
public User getUser() {
|
||||||
return userID;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserID(User userID) {
|
public void setUser(User user) {
|
||||||
this.userID = userID;
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRankingPointsSum() {
|
public int getRankingPointsSum() {
|
||||||
@ -36,11 +38,11 @@ public class User_Info implements Serializable {
|
|||||||
this.rankingPointsSum = rankingPointsSum;
|
this.rankingPointsSum = rankingPointsSum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Team getTeamID() {
|
public Team getTeam() {
|
||||||
return teamID;
|
return team;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTeamID(Team teamID) {
|
public void setTeam(Team team) {
|
||||||
this.teamID = teamID;
|
this.team = team;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user