many to many
@JoinColumn(name="userId",referencedColumnName = "id")
    private User user;
  @JoinColumn(name="dogId",referencedColumnName = "id")
    private Dog dog;
<many-to-one name="user" column="userId"
                     class="mhibernate.table.User"/>
        <many-to-one name="dog" column="dogId"
                     class="mhibernate.table.Dog"/>