title: @EmbeddedId with autogenerated id using @GenerateValue, this mix doesn't works as needed
body: <p>I am trying to work with @EmbeddedId, this is my code as follows,</p>
  
  <pre><code>create table TBL_EMPLOYEE_002(
    ID integer generated always as identity (start with 100,increment by 10), 
    COUNTRY varchar(50),
    NAME varchar(50),
    constraint PK_EMP_00240 primary key(ID,COUNTRY)
  )
  </code></pre>
  
  <p>The Embedded class as follows,</p>
  
  <pre><code>@Embeddable
  public class EmployeeIdTwo implements Serializable{
       public EmployeeIdTwo(){}
      public EmployeeIdTwo(String country){
          this.empCountry = country;
      }
  
      @GeneratedValue(strategy=GenerationType.IDENTITY)
       @Column(name="ID") 
      private Integer employeeId;
  
      @Column(name="COUNTRY",length=50)
      private String empCountry;
  
  // implementation of hashCode and equals and only getters 
  ...
  }
  </code></pre>
  
  <p>employee Entity as follows,</p>
  
  <pre><code>@Entity
  @Table(name="TBL_EMPLOYEE_002")
  public class EmployeeEntitySix implements Serializable{
  
      public EmployeeEntitySix(){}
      public EmployeeEntitySix(EmployeeIdTwo id,String name){
          this.id = id;
          this.employeeName = name;
      }
  
      @EmbeddedId    
      private EmployeeIdTwo id;
  
      @Column(name="NAME")
      private String employeeName;
  
  // getters and setters
  }
  </code></pre>
  
  <p>this is the code written in main method,</p>
  
  <pre><code>private static void storVal(EntityManager em){
      EmployeeEntitySix employee = new EmployeeEntitySix(new EmployeeIdTwo("KENYA"), "Henry Olaanga");
      em.persist(employee);
  }
  </code></pre>
  
  <p>but once i run an above code i get an exception as follows,</p>
  
  <pre><code>Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: Attempt to modify an identity column 'ID'. 
  </code></pre>
  
  <p>Can you please let me know where i am getting wrong,
  if my EmbeddedId class contain an autogenerated column, than what should be the approach.</p>
  
  <p>Just to know I am using hibernate as persistence provider and JPA as persistence API</p>