When mapping many-to-many relationships in JPA, configuration for the table used for the joining foreign-keys can be provided using the @JoinTable annotation:
@Entity
public class EntityA {
@Id
@Column(name="id")
private long id;
[...]
@ManyToMany
@JoinTable(name=...