title: Spring Data JPA table join creating operator does not exist error
body: <p>I have two tables, <code>Projects</code> and <code>TransitionAction</code>. Both <code>Projects</code> and <code>TransitionAction</code> have a column <code>request_no</code> which is used perform join between them. The entity classes are as below:-</p>
  
  <p>Project.java</p>
  
  <pre><code>@Entity
  public class Project implements Serializable {
  private static final long serialVersionUID = 1L;
  @Id 
  @SequenceGenerator(schema = "public", name="project_id_seq_gen",sequenceName="project_id_seq",initialValue=1,allocationSize=1)
  @GeneratedValue(strategy= GenerationType.SEQUENCE,generator="project_id_seq_gen")   
  private Integer id;
  
  @Column(name = "request_no")
  private String request_no;
  @Column(name = "title")
  private String title;
  @Column(name = "department")
  private String department;
  
  @OneToMany(cascade = CascadeType.ALL, mappedBy = "requestNo")
  private Set&lt;TransitionAction&gt; tacts;
  
  @ManyToOne
  @JoinColumn(name = "status_id")
  private Status status;
  
  @ManyToOne
  @JoinColumn(name = "level_id")
  private ProjectLevel level;
  </code></pre>
  
  <p>TransitionAction.java</p>
  
  <pre><code>@Entity
  @Table(name = "transitionaction")
  public class TransitionAction implements Serializable {
      private static final long serialVersionUID = 1L;
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
  
      @Column(name = "request_no")
      private String request_no;
  
      @Column(name = "actionDate")
      private Date actionDate;
  </code></pre>
  
  <p>The code used to retrieve the list of projects as follows:-</p>
  
  <pre><code>public interface UserInfoRepository extends JpaRepository&lt;UserInfo, Long&gt; {
  
  UserInfo findByUserName(String userName);
  
  @Query("SELECT project FROM Project project Join project.tacts pta where project.request_no= pta.request_no and project.status.id=1")
  List&lt;Project&gt; getAllUserProjects();
  }
  </code></pre>
  
  <p>I am getting could not extract ResultSet error. When I checked console, i found the following query being generated:</p>
  
  <pre><code>select
          distinct project0_.id as id1_1_,
          project0_.department as departme2_1_,
          project0_.level_id as level_id6_1_,
          project0_.user_nodal_officer as user_nod3_1_,
          project0_.request_no as request_4_1_,
          project0_.status_id as status_i7_1_,
          project0_.title as title5_1_ 
      from
          project project0_ 
      inner join
          transitionaction tacts1_ 
              on project0_.id=tacts1_.request_no
  </code></pre>
  
  <p>I am not getting why project. id is joined with tact.request_no and creating the error </p>
  
  <blockquote>
    <p>Operator does not exist: integer = character varying</p>
  </blockquote>