I have the following error when I delete a record in a table.
(Extract from the log file)
Code:
...
delete
from
custom_question
where
question_id=?
.....
insert
into
custom_question_AUD
(REVTYPE, question_answers, question_number, question_text, question_type, required, enroll_id, question_id, REV)
values
(?, ?, ?, ?, ?, ?, ?, ?, ?)
ERROR [org.hibernate.util.JDBCExceptionReporter] (http-BIO213%2F192.168.2.151-443-4) ORA-01400: cannot insert NULL into ("FRAMEWK2"."CUSTOM_QUESTION_AUD"."ENROLL_ID")
My entity is the following:
Code:
@Entity
@Audited
@Table(name = "custom_question")
public class CustomQuestion implements Serializable {
private static final long serialVersionUID = -3487942307494801788L;
private long questionId;
private EnrollInfo enrollInfo;
private String questionText;
private String questionType;
private String questionAnswers;
private long questionNumber;
private Character required;
Here is the audit table definition:
Code:
CREATE TABLE "FRAMEWK2"."CUSTOM_QUESTION_AUD"
(
"QUESTION_ID" NUMBER(19,0) NOT NULL ENABLE,
"REV" NUMBER(10,0) NOT NULL ENABLE,
"REVTYPE" NUMBER(3,0),
"QUESTION_ANSWERS" VARCHAR2(255 CHAR),
"QUESTION_TEXT" VARCHAR2(255 CHAR),
"QUESTION_TYPE" VARCHAR2(255 CHAR),
"ENROLL_ID" NUMBER(19,0),
"REQUIRED" CHAR(1 BYTE),
"QUESTION_NUMBER" NUMBER(5,0),
PRIMARY KEY ("ENROLL_ID", "REV") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE,
CONSTRAINT "CUSTOM_QUESTION_AUD_REV" FOREIGN KEY ("REV") REFERENCES "FRAMEWK2"."REVINFO" ("REV") ENABLE NOVALIDATE
)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
)
TABLESPACE "USERS" ;
What am I doing wrong? The delete is fine but the auditing is visibly not working.
Thx