( Hibernate Oracle cannot insert NULL ) How to insert auto generated ID?
<p>I am working on project where I am using hibernate to perform CRUD operations. I have user model and I am trying to insert the information but keeping getting this error</p>

<pre><code>Hibernate: insert into APPUSER (dob, email, firstName, lastName, password) values (?, ?, ?, ?, ?)
Jun 21, 2016 2:17:07 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 1400, SQLState: 23000
Jun 21, 2016 2:17:07 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: ORA-01400: cannot insert NULL into ("MYAPP8785"."APPUSER"."ID")
</code></pre>

<p>The user model looks like </p>

<pre><code>@Entity
@Table(name="APPUSER")
public class AppUser {


    @Id 
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Email
    @Size(max = 50)
    private String email;

    @Column
    private String dob;

    @Column
    private String firstName;

    @Column
    private String lastName;

    @Column(name = "password", nullable = false)
    private String password;
}
</code></pre>

<p>Hibernate properties  like </p>

<pre><code>properties.put("hibernate.dialect","org.hibernate.dialect.MySQLDialect");
//properties.put("hibernate.current_session_context_class","thread");
properties.put("hibernate.hbm2ddl.auto","update");
properties.put("hibernate.show_sql","true");
</code></pre>

<p>I am under the impression that hibernate would auto generate id for me and insert them using sequence</p>