That error usually happens with incorrect mappings that lead to circularities or shared reference between/to collections. I would need to see the complete mappings to understand more specifically what’s going on, but I suspect you might be doing something wrong when setting referencedColumnName
(seeing as you were setting both to apl_id
you might be referencing a foreign key with itself).
Note that in @JoinColumn
, the name
member specifies the name of the foreign key column on the association owner’s table, while referencedColumnName
indicates the name of the column on the association target’s table which is the target of said foreign key.