How to fix “Error executing DDL ”alter table events drop foreign key FKg0mkvgsqn8584qoql6a2rxheq“ via JDBC Statement”

前端 未结 9 1526
刺人心
刺人心 2021-02-04 04:44

I\'m trying to start spring boot project with MySQL database, but I have some problem with database. I try to start my application that, and server is running but hibernate don\

9条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 04:56

    Ok, had the same issue. Adding prefixes fixed the problem for me:

    from:

    `
    @Entity
    @Table(name = "result_man")
    @Proxy(lazy = false)
    public class ResultManEntity {
    @Id
    @GeneratedValue
    @Column(name = "id", unique = true, length = 128)
    private long id;
    private String key;
    private int score;
    private int index;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "result_id")
    private ResultEntity result;
    }`
    

    to:

    `@Entity
    @Table(name = "result_man")
    @Proxy(lazy = false)
    public class ResultManEntity {
    @Id
    @GeneratedValue
    @Column(name = "id", unique = true, length = 128)
    private long id;
    private String _key;
    private int _score;
    private int _index;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "result_id")
    private ResultEntity result;`
    

提交回复
热议问题