#database

DummyEntity라는 엔티티가 있다고 해보겠습니다. 특별한 건 없고, modifiedAt 이라는 필드에 @PreUpdate 어노테이션이 선언되어 있습니다.

1
2
3
4
5
6
7
8
// DummyEntity.javascript
private String description;
private Date modifiedAt;

@PreUpdate
public void preUpdate() {
modifiedAt = new Date();
}

아래의 DummyServiceImpl 제가 짠 소스 코드 입니다. 문제가 있는 소스 코드입니다. 회사 코드가 유출되면 안되니 간단하게 바꾸었습니다. 엔티티를 조회한 다음, 엔티티의 특정 필드의 값을 수정하여 변경 사항을 저장한 후에 큐로 이벤트를 발행할 때, modifiedAt 에는 변경이 이루어진 시간을 세팅하여 전달하고 싶었습니다.

Read More

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×