title: Spring JPA - how to allow duplicate entries for @Id
body: <p>I am querying a view which joins three tables and returns the result like below:</p>
  <pre><code>select * from v_project_details
  
  Project_ID  Repo_Name Branch_Name
  100         Repo1      Branch1
  100         Repo1      Branch2
  101         Repo2      Branch2
  
  @Getter
  @Setter
  @Entity
  @Table(name='v_project_details')
  public class ProjectDetails{
  
  @Id
  @Column(name=&quot;Project_Id&quot;)
  private int ProjectId
  }
  
  @Column(name=&quot;Repo_Name&quot;)
  private String RepoName
  }
  
  @Column(name=&quot;Branch_Name&quot;)
  private String BranchName
  }
  
  @Query(select p from v_project_details p)
  List&lt;ProjectDetails&gt; findAll();
  
  Results:
  
  Project_ID  Repo_Name Branch_Name
  100         Repo1      Branch1
  100         Repo1      Branch1 - I am expecting Branch2 here
  101         Repo2      Branch2
  </code></pre>
  <p>when i query the table from spring jpa, i see three results but first row is repeated twice.</p>
  <p>Looks like hibernate is not reinstantiating the object if @Id value is repeated more than once in the result set.</p>
  <p>How do i force it to reinstantiate the object ? I do not have an unique identifier in the view as my view is joined from different tables.</p>