MappingException: Repeated column in mapping for collection ManyToMany

I have a ManyToMany mapping like this (I have changed the name of columns and properties):

	@ManyToMany(fetch = FetchType.LAZY)
					@JoinColumn(name="ID_ACTION", referencedColumnName="ID_ACTION"),
					@JoinColumn(name="ID_COMPANY", referencedColumnName="ID_COMPANY"),
					@JoinColumn(name="TYPE", referencedColumnName="TYPE")
					@JoinColumn(name="ID_CONTACT", referencedColumnName="ID_CONTACT"),
					@JoinColumn(name="TYPE", referencedColumnName="TYPE")
	private List<Contact> contacts;

But I get the exception:

org.hibernate.MappingException: Repeated column in mapping for collection: mypackage.ActionCompany.contacts column: TYPE

It is possible to declare a ManyToMany mapping with the same column used in in both joinColumns oand inverseJoinColumns? If not, is there some alternative?

I have already tried to use insertable and updatable = false in one of the join declarations for column TYPE, but I still get the same exception.

This sounds like a limitation. Please write a replicating test case and open a Jira issue with the test attached.

Meanwhile, you can work around this issue by mapping the intermediary table as an entity. The intermediary entity will have 2 @ManyToOne associations to the Contact and Action entities while the Contact and Action entities will have @OneToMany mappedBy associations.

For more details about this mapping, check out this article.