Quantcast
Channel: How to set a lock for the entire entity or table in hibernate - Stack Overflow
Viewing all articles
Browse latest Browse all 3

How to set a lock for the entire entity or table in hibernate

$
0
0

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.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images