执行DDL错误“更改表存在删除外键

时间:2019-06-06 17:58:53

标签: hibernate spring-boot jpa

我尝试创建一个数据库,并且创建了数据库,但是控制台上有很多问题,例如     -无法删除'FKtiawuk7lv5graw3ej5y046yjf'     -:通过JDBC语句执行DDL“更改表存在删除外键FKcblq169hiqsjgxkpka8lob79n”时出错     -通过JDBC语句执行DDL“更改表存在删除外键FKrlqy7vwa7b8qdovhifl0vg99t”时出错

I am working with spring boot hibernate mysql xammp

这是我的班级实体

@Entity
@Data
@NoArgsConstructor
public class Activite implements Serializable {

    @Id
    @GeneratedValue
    private Long id;
    private String nom;
    private String description;
    private Double prix;
    private String type_activite;

    @OneToMany(mappedBy = "activite", fetch = FetchType.LAZY)
    private List<Detail_Activite> detail_Activite;

    @ManyToOne()
    @JoinColumn(name = "id_salle")
    private Salle salle;

    @ManyToOne()
    @JoinColumn(name = "id_aminateur")
    private Animateur animateur;



@Entity
@Data
@NoArgsConstructor
public class Adherent implements Serializable {

    @Id
    @GeneratedValue
    private Long id;
    private String nom;
    private String prenom;
    private String age;
    private String sexe;
    private String adresse;

    @ManyToOne()
    @JoinColumn(name = "id_groupe")
    private Groupe groupe;

    @ManyToOne()
    @JoinColumn(name = "id_parent")
    private Parent parent;

    @OneToMany(mappedBy = "adherent",fetch=FetchType.LAZY)
    private List<Presence> Presence;

    @OneToMany(mappedBy = "adherent",fetch = FetchType.LAZY)
    private List<Recouvrement > recouvrement;



@Entity
@Data
@NoArgsConstructor
@PrimaryKeyJoinColumn(name = "id")
public class Animateur extends Personne {

    private String specialite;

    @OneToMany(mappedBy = "animateur", fetch = FetchType.LAZY)
    private List<Activite> activite;


create database with no error

0 个答案:

没有答案