I define an Entity with a Generated Id value, but when I try to do an insert I got this error :
10:33:32,202 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-8) SQL Error: 2289, SQLState: 42000
10:33:32,203 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-8) ORA-02289: sequence does not exist
10:33:32,205 ERROR [org.jboss.as.ejb3.invocation] (default task-8) WFLYEJB0034: EJB Invocation failed on component javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
Caused by: java.sql.SQLSyntaxErrorException: ORA-02289: sequence does not exist
Entity :
@Entity
@Table(name = "TYPEDEM")
public class TypeDem {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "ID")
private long id;
@Column(name = "CODE")
private String code;
@Column(name = "LABEL")
..
}
Claass :
@Override
public TypeDem save(TypeDem typeDem) {
entityManager.persist(typeDem);
return typeOfDemand;
}
In debug, I see that the value of id is null