title: Return Data of two tables using mysql join as one java Object in Spring boot
body: <p>CPT Table</p>
  
  <pre><code>@Entity
  @Table(name = "CPT")
  public class CPTCodeset {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "Id")
      private int id;
  
      @Column(name = "Code")
      private String code;
  
      @Column(name = "Description")
      private String desc;
  //getters and setters
  }
  </code></pre>
  
  <p>CPT Procedures Table</p>
  
  <pre><code>@Entity
  @Table(name = "cptprocedures")
  public class CPTProcedures {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "Id")
      private int Id;
  
      @OneToOne(fetch=FetchType.EAGER)
      @JoinColumn(name = "ProcedureId")
      private Procedure procedure;
      @Transient
      private int procedureId;
  
      @OneToOne(fetch=FetchType.EAGER)
      @JoinColumn(name = "CPTCodeSet")
      private CPTCodeset cpt;
      @Transient
      private int cptCodeSet;
  //getters and setters
  }
  </code></pre>
  
  <p>CPTRepository</p>
  
  <pre><code>@Query(nativeQuery = true, value = "SELECT cp.ProcedureId,c.Code,c.Description FROM cptprocedures cp JOIN CPT c ON cp.CPTCodeSet = c.Id where c.Description like \"%ane\";")
  List&lt;CPTCodeset&gt; findBySearch(@Param("searchString") String searchString);
  </code></pre>
  
  <p>This Query Returning Data is what I want. But how can I map this data into a single object where as it includes 2 tables.</p>
  
  <p>How can I do it by using <code>@Entity</code> without creating a table. Any suggestions?</p>