Behavior Soft Delete Hibernate Spring Boot

1

I would like to know if there is a soft delete functionality in Hibernate, since today I'm doing something that I consider to be a gambiarra, something like:

@Entity
@Where(clause="ativo=1")

Controller:

Rejeicao rej = rejeicaoRepository.findOne(id);
if(rej != null){
    rej.setAtivo(0);
    rejeicaoRepository.save(rej);   
}

If someone has a better way to do it, I'd appreciate it.

    
asked by anonymous 10.06.2015 / 16:48

0 answers