Hi ningpp , the ddl generated is correct, you are using the same table name of MiddleTable4 Entity as the @JoinTable of a @ManyToMany
so these columns should be not null, the issue is the MiddleTable4 id column middle4_id}}does not correspond to any column of the join table, so when a{{MainMultiPks is saved the generated SQL insert statement for the Join table insert into middle_table4 (main_id2, main_id1, dest4_id1, dest4_id2, dest4_id3) values (?, ?, ?, ?, ?) contains all the columns specified by the @JoinTable but obviously not the MiddleTable4 id column and this causes the error ERROR: NULL not allowed for column "MIDDLE4_ID"; |