Unwanted unique constraint when using @ManyToMany JPA annotation
<p>I'm using spring-boot / spring-data-jpa for my project. Entities below will create tables in oracle when spring.jpa.hibernate.ddl-auto is set to update.</p>

<pre><code>@Entity
@Table(name = "SCENARIO")
public class Scenario {

    private Integer worksetId;
    private Integer ruleSetId;
    private Set&lt;Rule&gt; rules;

    @Id
    public Integer getWorksetId() {
        return worksetId;
    }

    public void setWorksetId(Integer worksetId) {
        this.worksetId = worksetId;
    }

    @Column(name = "RULE_SET_ID")
    public Integer getRuleSetId() {
        return ruleSetId;
    }

    public void setRuleSetId(Integer ruleSetId) {
        this.ruleSetId = ruleSetId;
    }

    @ManyToMany
    @JoinTable(name = "RULE_SET", joinColumns = @JoinColumn(name = "WORKSET_ID", referencedColumnName = "RULE_SET_ID"), inverseJoinColumns = @JoinColumn(name = "RULE_ID", referencedColumnName = "ID"))
    public Set&lt;Rule&gt; getRules() {
        return rules;
    }

    public void setRules(Set&lt;Rule&gt; rules) {
        this.rules = rules;
    }

}

@Entity
@Table(name = "RULE")
public class Rule {
    private Integer id;
    private String description;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

}
</code></pre>

<p>What I'm expecting is pretty straightforward that SCENARIO / RULE table will be created, as well as a mapping table named RULE_SET. Everything goes well except that an unwanted unique constraint on RULE_SET_ID in table SCENARIO is created but obviously same RULE_SET_ID should be able to be shared by several scenarios. Could anyone kindly help? Much appreciated!!</p>

<p>BTW, I'm using spring-boot 1.4.0 with hibernate 5.0.9</p>