<set name="Units" table="UNIT" mutable="false">
<cache usage="read-only"/>
<key column="ID"></key>
<many-to-many column="U_ID" class="com.org.Unit"/>
I have declared variable in Supplier.java
as:
private Set <Unit> Units;
In your entity class Supplier
put:
private Set<Unit> units;
@ManyToMany
@JoinTable(name="UNIT", joinColumns={@JoinColumn(name="ID")},
inverseJoinColumns={@JoinColumn(name="U_ID")}
)
public Set<Unit> getUnits() {
return units;
}