Both columns need to be specified as Join Columns. Consider:
@ElementCollection
@CollectionTable(
name = "person_location",
joinColumns = {
@JoinColumn(name = "person_id"),
@JoinColumn(name = "location_id")
}
)
...
Please post more details in JPA form, so that a tested answer is possible.