Search code examples
javaspringspring-bootjavers

Javers audit a custom delete


What way Javers audit a custom 'delete'? Using spring-boot integration, for example:

@Transactional
@Modifying
@Query(" delete from ExecutePayment exeP " +
                " where exeP.customer = :customer " +
                "   and exeP.status = 'EXECUTED' ")
        void deletePendingExecutionsFromCustomer(@Param("customer") Customer customer);

Solution

  • JaVers doesn't support JPA query language. You need to wrap this method and call javers.commitShallowDelete() manually.