title: Mapping a table with only foreign keys in hibernate
body: <p>I am new to hibernate and i want to map a table having only foreign keys using xml file.
  I have 3 tables 
  1.UserInfo(for user details with a primary key)
  2.AuthorInfo(containing author details with a primary key)
  3.AuthorFollow(to map which user is following which author).
  The AuthorFollow table contains only 2 columns UserId and AuthorId both are having relationships(foreign keys) with the 1st 2 tables respectively.
  I haven't given any index on these columns.</p>
  
  <p>I have written below code in AuthorFollow.hbm.xml</p>
  
  <p>But, its not working properly.</p>
  
  <pre><code>    &lt;?xml version='1.0' encoding='utf-8'?&gt;
  </code></pre>
  
  <p>
  
      </p>
  
  <pre><code>    &lt;composite-id&gt;
          &lt;key-many-to-one name="userId" column="user_id" class="com.pojo.hibernate.UserInfo" /&gt;
          &lt;key-many-to-one name="authorId" column="author_id" class="com.pojo.hibernate.AuthorInfo" /&gt;
      &lt;/composite-id&gt;
  
  &lt;/class&gt;
  </code></pre>
  
  <p></p>
  
  <p>(i have used mysql.)</p>
  
  <p>And, is the table structure proper?</p>