diff --git a/src/main/java/com/chint/infrastructure/repository/UserNameRepositoryImpl.java b/src/main/java/com/chint/infrastructure/repository/UserNameRepositoryImpl.java index 1d5d7fbb..73cb2dc9 100644 --- a/src/main/java/com/chint/infrastructure/repository/UserNameRepositoryImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/UserNameRepositoryImpl.java @@ -5,6 +5,7 @@ import com.chint.domain.aggregates.user.UserName; import com.chint.domain.repository.UserNameRepository; import com.chint.infrastructure.repository.jdbc.JdbcUserNameRepository; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Repository; import java.util.Optional; @@ -13,6 +14,8 @@ import java.util.Optional; public class UserNameRepositoryImpl implements UserNameRepository { @Autowired private JdbcUserNameRepository jdbcUserNameRepository; + + @Cacheable(value = "user::name", key = "#employeeNo") @Override public Optional findByEmployeeNo(String employeeNo) { return jdbcUserNameRepository.findByEmployeeNo(employeeNo);