I got this to work, but in order to do so I had to explicitly define the join table.
Otherwise it was looking for an articles_id column when loading Person and a authors_id column when loading Article.
After explicitly defining the join table & columns it is working just fine.
I'm using 3.5.1-FINAL
PersonCode:
@NotNull
@ManyToMany(cascade = { CascadeType.REFRESH }, fetch = FetchType.LAZY, mappedBy=authors)
private List<Articles> articles = new ArrayList<Articles>();
ArticleCode:
@NotNull
@JoinTable(name="Article_Person",
joinColumns=
@JoinColumn(name="Article_id", referencedColumnName="id"),
inverseJoinColumns=
@JoinColumn(name="authors_id", referencedColumnName="id")
)
@ManyToMany(cascade = { CascadeType.REFRESH }, fetch = FetchType.LAZY)
@Cascade( { org.hibernate.annotations.CascadeType.DETACH, org.hibernate.annotations.CascadeType.LOCK, org.hibernate.annotations.CascadeType.REFRESH, org.hibernate.annotations.CascadeType.REPLICATE })
private List<Person> authors = new ArrayList<Person>();