Reputation: 73
I am looking for a solution on how to include a field to an audit table, which is not marked as @Audited.
I have such a DB structure:
create table user (
id CHAR(36) not null,
first_name varchar(200) not null,
last_name varchar(200) not null,
phone_number varchar(15),
primary key (id)
);
@Audited annotation is placed at first_name and last_name field in User.class, as a result below audit table is created:
create table user_aud (
id CHAR(36) not null,
rev integer not null,
revtype tinyint,
first_name varchar(200),
last_name varchar(200),
primary key (id,rev)
) engine=InnoDB;
I would like to additionally have in my user_aud table column phone_number but phone_number change shouldn't create a new revision. I don't want to follow changes of phone_number, but still, keep it as a part of the audit record.
I would be grateful for information how it could be done if it is possible. I am using 5.4.4.Final Hibernate version.
Upvotes: 1
Views: 1519
Reputation: 3478
Check out this topic and let me know if it covers your case. For me it seems like it should work for you.
not to create revision for particular column change
Upvotes: 1