我有一个问题,hibernate正在创建一个sql查询,并在join语句中添加tablename\u columnname?如果我在hibernate属性中使用update,hibernate将创建新的列,如下所示:这是来自另一个表的,但是您将得到图片,这与针对团队的解决方案相同?
错误
这些是我的实体
@Entity
@Table(name = "tournament_team")
public class TournamentTeam implements Serializable {
@Id
@Column(name = "tourId")
private long tournamentsTourId;
@Id
@Column(name = "teamId")
private long teamsTeamId;
@Column(name = "mmr")
private Integer mmr;
@Column(name = "placement")
private Integer placement;
@Column(name = "teamConfirmed")
private String teamConfirmed;
private String checkedAt;
@ManyToOne(fetch = FetchType.LAZY)
private Team teams;
@OneToMany(mappedBy = "tournamentTeam",fetch = FetchType.LAZY)
private List<TourTeamPlayer> tourTeamPlayers;
@Entity
public class Team {
@Id
private long teamId;
private String teamName;
private Long teamCaptainId;
private Timestamp createdAt;
private String imgUrl;
private String teamRegion;
@ManyToMany(mappedBy = "teams",fetch = FetchType.LAZY)
private List<Player> players = new ArrayList<>();
// @OneToMany(mappedBy = "teams",fetch =FetchType.LAZY )
// private List<PlayerTeam>playerTeams;
@ManyToMany(mappedBy = "teams",fetch = FetchType.LAZY)
private List<Tournament> tournaments = new ArrayList<>();
public long getTeamId() {
return teamId;
}
@OneToMany(mappedBy = "teams",fetch = FetchType.LAZY)
private List<TournamentTeam>tournamentTeams;
@OneToMany(mappedBy = "teams",fetch = FetchType.LAZY)
private List<PlayerTeam>teamPlayers;
暂无答案!
目前还没有任何答案,快来回答吧!