title: Get data from two tables and insert in one table through HQL
body: <p>I have two entity classes <code>Student.java</code> and <code>Course.java</code> and they have <code>many to many</code> relationship between them I want to add one entry into their <code>@JoinTable</code> through hql like this :  </p>
  
  <pre><code>insert into student_course(student_id,course_id) values('" + courseId + "','" + studentId + "')". 
  </code></pre>
  
  <p>I want to use hql instead of sql. Any ideas?</p>