I want to lock a table at the entity level in Hibernate/Spring Data JPA.
This is a mock-up of my code:
@Entity@Data@Table(name = "Armor")public class Armor { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @OptimisticLocking private String armorBrand;}
Can I do this but for the entire table?
I'm currently using JpaRepository for my updates. I would like to keep using it instead of EntityManager.