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 3 fields, lojaMaster
, seguradora
, tabelaSeguro
. Which are related to itself 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 shows me the following message in Eclipse.
com.sun.jdi.InvocationException
And they are null
. Strange that when I perform some operation on this table it writes to the aud
table, the records usually, like the ids
of those table.
Am I doing something wrong? How do I proceed to be able to audit this table?