0
I am trying to accomplish the construction of a history of a given table.
@Entity
@Table(name = "RUBRICA_INSTITUTO)
@Getter
@Setter
@Audited
@Audittable( "RUBRICA_INSTITUTO_AUDITORIA" )
@Allargsconstructor
@Noargsconstructor
@Builder
@Equalsandhashcode(of = {"id", "dtAtualization", "institute", "heading"})
public class Rubricainstituto Implements Ientity{
@Id
@Generatedvalue(Strategy = Generationtype.IDENTITY)
@Column(name = "CO_RUBRICA_INSTITUTO", nullable = false)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CO_INSTITUTO", nullable = false)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@JsonIgnore<br>
private Instituto instituto;
I want the data of this Audit Table RUBRICA_INSTITUTO_AUDITORIA, but I want to pass as parameter another field and not the Entity Id RUBRICA_INSTITUTO_AUDITORIA. There is the . Property() option, in case inside it I would inform the attribute I want to make the comparison.
But the property that I would like to carry out the comparison is the Institute Id, however
In the construction of the method I have no idea how to do this.
public List<RubricaInstituto> getHistorico(Long id)
AuditQuery query = auditReader.createQuery()
.forRevisionsOfEntity(RUBRICA_INSTITUTO.class, true, false)
.add(AuditEntity.property("CO_INSTITUTO").eq(id))
I would like to search not for the id of the table CO_RUBRICA_INSTITUTO, more by another field, but this other field and the Institute type. So it doesn’t work.