我有两个java models球员和球队。我有一个控制器类。当我从用户界面通过 ajax 发送发布请求时出现错误。我已经解决了类似的错误CORS。但是有一个错误我无法解决;knockout.js没有发生调试错误和发布请求。我的数据库没有变化。我共享了模型类、控制器类、html 和javascript文件。
我需要改变什么?你能帮忙吗?
播放器模型
@Entity
@Table(name = "player")
public class Player{
@Id
@GeneratedValue
@NotNull
@Column
private int id;
@NotNull
@Column
private String playerName;
@NotNull
@Column
private String playerSurname;
@Column
private int playerAge;
public String getPlayerName() {
return playerName;
}
public void setPlayerName(String playerName) {
this.playerName = playerName;
}
public String getPlayerSurname() {
return playerSurname;
}
public void setPlayerSurname(String playerSurname) {
this.playerSurname = playerSurname;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPlayerAge() {
return playerAge;
}
public void setPlayerAge(int playerAge) {
this.playerAge = playerAge;
}
}
团队模型
@Entity
@Table(name = "team")
public class Team {
@Id
@GeneratedValue
@NotNull
@Column
private int id;
@NotNull
@Column
private String teamName;
@Column
private String teamCountry;
public Team(){
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getTeamCountry() {
return teamCountry;
}
public void setTeamCountry(String teamCountry) {
this.teamCountry = teamCountry;
}
@ManyToOne
private Player player;
public Player getPlayer() {
return player;
}
public void setPlayer(Player player) {
this.player = player;
}
}
浮云间
相关分类