PrePersist
![[SpringBoot] JPA Entity Listener 엔티티 이벤트 리스너](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fb2MgXc%2FbtrBbb5SRme%2FAAAAAAAAAAAAAAAAAAAAAEW1y4RUNdK87hToD8nS0SltNXus-8B0y-2eWf5wnj3V%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DxLiMDyAwDLBlKjsbnryzCwyZi6Y%253D)
[SpringBoot] JPA Entity Listener 엔티티 이벤트 리스너
YOPLE서비스를 개발하면서 Entity가 저장될 때 또는 조회할 때의 이벤트를 캐치하여 처리를 해야 하는 이슈가 발생했다. 그러던 중 JPA에서 아주 편안한 기능을 제공한다는것을 알게 되었고 포스트로 기록을 남긴다. JPA에서는 Entity에 이벤트가 발생할 때 특정 처리를 할 수 있게 지원한다. Entity Listener Chapter 6. Entity listeners and Callback methods @PostPersistExecuted after the entity manager persist operation is actually executed or cascaded. This call is invoked after the database INSERT is executed. docs.jb..