Introduction In this article, we are going to see how we can implement a soft delete mechanism when the JPA entity features a version property. If you are not using a version property for optimistic locking, then you can implement the soft delete strategy, as explained in this article. Domain Model Let’s assume we have the following Post, PostDetails, PostComment, and Tag entities that extend the SoftDeletable base class, as illustrated by the following diagram: Soft delete when the entity has a JPA version property Now, we want to instruct Hibernate to... Read More