hibernate将表名添加到查询中,如join column+name of column

vsikbqxv  于 2021-06-30  发布在  Java
关注(0)|答案(0)|浏览(169)

我有一个问题,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;

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题