title: How to make EclipseLink not generate primary keys and let that to the Database
body: <p>I use Liquibase to create the DDL schema of the database(Derby). Also, I use JPA and EclipseLink and I want to make EclipseLink so that it does not insert any values for primary keys and I want them to be generated through the pure sql. Now, I`ve tried to remove the generation type strategy in the entities, but it is trying to insert null values for PKs to the tables, which are not allowed for PKs.</p>
  
  <p>I`ll be glad if you help me.</p>
  
  <p>Now I have this, but it gives me the exception below.</p>
  
  <pre><code>@Entity
  @XmlRootElement
  @Table(name = "ROLE")
  public class Role implements Serializable {
  
      private static final long serialVersionUID = 4736444799522006644L;
  
      @ Id
      @ JsonIgnore
      @ GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "ID")
      private Long id;
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>CREATE TABLE Role (
  id BIGINT PRIMARY KEY NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
  role VARCHAR(255)
  );
  </code></pre>
  
  <p>Exception Description: The attribute [id] of class [...] is mapped to a primary key column in the database. Updates are not allowed.</p>