I'm using @PreUpdate annotation in an entity class in Spring project as follow:
@Entity
public class Room {
@Id
@GeneratedValue
private Long id;
// Other fields and Getters and Setters
@PreUpdate
public void preUpdate(){
System.out.println("pre Update");
}
}
Now in every query, preUpdate method called, Even query to another entities. Is this logic is correct? I think It's a bit illogical.