title: JPA : @SequenceGenerator is not generating the sequence
body: <p>I my application I have used JPA with Hibernate vendor and Oracle 11G DB.</p>
  
  <p>Here I am using the native query as follow on my MST_EMP table ..</p>
  
  <pre><code>  Query query  = this.entityManager.createNativeQuery("INSERT  INTO MST_EMP emp (" +
                      "EMP_NAME,EMP_MAIL_ID) VALUES ('dasdas',?)");
              query.setParameter(1,"dhrumil");
              query.executeUpdate();          
  </code></pre>
  
  <p>Here is my MST_EMP entity details..</p>
  
  <pre><code>@Table(name = "MST_EMP")
  public class MstEmp implements Serializable, IsEntity {
  
      private static final long serialVersionUID = 1L;
  
      @Id 
      @Column(name = "EMP_CODE")
      @SequenceGenerator( name = "EMP_CODE_SEQ", sequenceName = "EMP_CODE_SEQ")   
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EMP_CODE_SEQ")
      private String empCode;
  
  
      @Column(name="EMP_MAIL_ID")
      private String empMailId;
  
  
      @Column(name="EMP_NAME")
      private String empName;
  
      public MstEmp() {
      }
  
      public String getEmpCode() {
          return this.empCode;
      }
  
      public void setEmpCode(String empCode) {
          this.empCode = empCode;
      }
  
      public String getCreatedBy() {
          return this.createdBy;
      }
  
  
      public void setEmpMailId(String empMailId) {
          this.empMailId = empMailId;
      }
  
  
  
      public String getEmpName() {
          return this.empName;
      }
  
      public void setEmpName(String empName) {
          this.empName = empName;
      }
  
  }
  </code></pre>
  
  <p>As per my understanding, we dont need to give value to EMP_CODE in the native query. Because sequence is associated with it.</p>
  
  <p>But this query gives me error like this ..</p>
  
  <pre><code>SEVERE: ORA-01400: cannot insert NULL into ("PERK"."MST_EMP"."EMP_CODE")
  
  SEVERE: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute native bulk manipulation query
      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1179)
      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1112)
  </code></pre>
  
  <p>Can any one tell me, Do we need to provide EMP_CODE in the native query ?</p>
  
  <p>Will native query , do not refer the sequence automatically declared in the Entity?</p>
  
  <p>Thanks.</p>