-1
I have the following class.
@Entity
@Audited
@GenericGenerator(name = "Sequence_Generic", strategy = "com.paradigma.ecred.dao.hibernate.generator.ManualGenerator") // sequence generic criado para a atividade 510
@SelectBeforeUpdate @DynamicUpdate
public class Loja extends Persistent {
@Trim
@NotBlank(message = "O preenchimento do campo \"CNPJ\" é obrigatório.")
@CNPJ(message = "O \"CNPJ da loja\" é inválido")
private String cnpj;
@Trim
@NotBlank(message = "O preenchimento do campo \"Razão social\" é obrigatório.")
@Size(max = 255, message = "A Razão social deve conter no máximo {max} caracteres.")
private String razaoSocial;
@ManyToOne(cascade=CascadeType.ALL)
@JoinColumn(name="idlojamaster", referencedColumnName = "id", columnDefinition="integer")
private Loja lojaMaster;
@ManyToOne
@JoinColumn(name="idseguradora", referencedColumnName = "id", columnDefinition="integer")
private Seguradora seguradora;
@ManyToOne
@JoinColumn(name="idTabelaSeguro", referencedColumnName = "id", columnDefinition="integer")
private TabelaSeguro tabelaSeguro;
// getter e setter
}
Along with these three fields, lojaMaster
, seguradora
, tabelaSeguro
. That are related to yourself and other tables. These other tables have their audit tables and their classes are marked with @audited.
But when I debug the code and click on one of these attributes, it presents the following message in Eclipse.
com.sun.Jdi.Invocationexception
And they stay null
. Strange that when I perform some operation in this table it records in the table aud
, the records normally, as the ids
of these tables.
Am I doing something wrong? How should I proceed to be able to perform the audit of this table?
Just so I can better understand what you are asking. Does your application provide users with data from the audit tables? For example:
pessoa_aud
,endereco_aud
,revtype
. And do you allow changes to these tables by users? What I don’t understand is the relationship you are drawing between the audit tables with the "normal" tables. There is no business relationship there, as the name says, it is only and only to audit (you know the modifications in the normal tables). And each audit table is independent of each other.– humungs
@Ricardogiaviti ,look I tried to quote an example out of what I am working on to be simpler. I will modify the description of the question text.
– Macario1983