-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: @Audited issue when deleting
PostPosted: Thu May 03, 2012 3:47 pm 
Newbie

Joined: Thu May 03, 2012 3:31 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.