title: Composite Primary key in JPA
body: <p>The EmbeddedId or IdClass annotation is used to denote a composite primary key.
  How can i use <strong>composite primary key without ( EmbeddedId or IdClass )</strong> ?</p>
  
  <p>If it is possible to use composite primary key without ( EmbeddedId or IdClass ) then how can i use <strong>EntityManager.find( Entity Class , Object primaryKey) method to find entity in case of composite primary key</strong>(Multiple Primarykey) (because of no IdClass or EmbeddedId) .  </p>
  
  <p>EclipseLink take List of pk in the find() operation but if composite pk key defined in example -</p>
  
  <pre><code>    Entity Person {
             @Id 
             String username;
             @Id
             String emailId;
             @Basic
             String firstName;
             @Basic
             String lastName;
      }
  
      List list = new ArrayList();
      list.add(${username});  //Run time value
      list.add(${emailId});   //Run time value
  </code></pre>
  
  <p>then <strong>EnitityManager.find(list)</strong> will take these arguments , is i am right?</p>
  
  <p>If i am assuming correct then how will EnitityManager.find() operation will know that List 1st argument is username or emailId pk value (means sequence of composite pk fields value)</p>