多对多关系设计是否正确

Does many-to-many relationship design properly

我创建了两个基于 Hibernate 的 table,它们彼此之间具有 多对多 关系。

tables:

@Entity
@Table(name = "Interests")
data class Interest(
    var description: String = "") : PanacheEntity()

@Entity
@Table(name = "Accounts")
data class Account(@field:Id var id: UUID? = null,
                   @ManyToOne(fetch = FetchType.LAZY) var gender: Gender? = null,
                   var birthday: Long = 0,
                   @ManyToMany(fetch = FetchType.LAZY, cascade = [CascadeType.PERSIST])
                   @JoinTable(
                       name = "user_interests",
                       joinColumns = [JoinColumn(name = "user_id")],
                       inverseJoinColumns = [JoinColumn(name = "interest_id")]
                   )
                   var interests: List<Interest> = listOf()) : PanacheEntityBase

在幕后,Hibernate 创建了一个单独的 table 来保存外键。这是生成的 DDL:

create table user_interests
(
    user_id     uuid   not null
        constraint fkfxfdgodf1o1gxd8offdxrhcwu
            references accounts,
    interest_id bigint not null
        constraint fkdtbf68t9l8ehm46bi6ko45kb5
            references interests
);

问题是,约束之后的神秘字符串是什么?DDL 是否正确定义?

感兴趣的是 class,也用反向映射声明“var accounts: List”!