79288080

Date: 2024-12-17 13:41:14
Score: 1.5
Natty:
Report link

Try using @ElementCollection annotation, generally, Hibernate Envers might not recognize changes to a collection of mutable objects like List<BigDecimal?>.

@Entity
@Audited
class ValuesHolder(

// other fields

@ElementCollection
@Column(columnDefinition = "NUMERIC(18,6)", nullable = false)
var values: List<BigDecimal?>,
)

@ElementCollection ensures that Hibernate treats the collection elements as part of the entity and performs dirty checking on the collection. Changes to the collection or its elements will be detected and audited by Envers.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @ElementCollection
  • Low reputation (1):
Posted by: MAYANK DEVRANI