I am going through some code and it uses nested @JoinColumn for one of the associations, as following:
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumns({@JoinColumn(name = "QuestId"), @JoinColumn(name = "GuildId")})
private GuildQuests guildQuest;
I understand that when I do something like the following:
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumns(name="GuildQuestId")
private GuildQuests guildQuest;
I am creating a column with the name GuildQuestId in the table and it has a foreign key constraint with the entity GuildQuests.
However, what will the nested @JoinColumn(first code snippet) do?