title: getting duplicate records when using @ManyToMany annotation
body: <p>i got 3 tables: 1.moduls with atribue id , 2.variant with attribute id  and 3.moduls_variant with attributes moduls_id, variant_id.</p>
  
  <p>I got these tables mapped into two classes:</p>
  
  <p>Moduls</p>
  
  <pre><code>@Entity
  @Table (name = "moduls")
  public class Moduls
      {
  
      @Id
      @GeneratedValue (strategy = GenerationType.IDENTITY)
      @Column (name = "id")...
     }
  </code></pre>
  
  <p>Variant</p>
  
  <pre><code>@Table(name = "variant")
  @Entity
  public class Variant{
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column (name = "id", unique = true)
      private Integer id;
      @ManyToMany(fetch = FetchType.EAGER,cascade =    CascadeType.ALL)
      @JoinTable(name = "moduls_variant",
      joinColumns = @JoinColumn(name = "variant_id") ,
      inverseJoinColumns =  @JoinColumn(name = "moduls_id") )
      private Set&lt;Moduls&gt; modulsSet = new HashSet&lt;Moduls&gt;();...
      }
  </code></pre>
  
  <p>And there goes my problem.
  Lets say that i got in table moduls items with IDs 1,2 and3.
  In table variant item with id 1.
  And finally in table moduls_variant 3 rows:</p>
  
  <p>1|1 </p>
  
  <p>1|2</p>
  
  <p>1|3</p>
  
  <p>Problem is that now when i want to get all items (I should get only 1 item) from table variant by using: </p>
  
  <pre><code>DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Variant.class);
  getHibernateTemplate().findByCriteria(detachedCriteria);
  </code></pre>
  
  <p>I get three times the same object from table variant (with the same ID)</p>