|
|
@@ -2,11 +2,13 @@ package com.izouma.nineth.repo;
|
|
|
|
|
|
import com.izouma.nineth.domain.User;
|
|
|
import com.izouma.nineth.security.Authority;
|
|
|
+import org.springframework.cache.annotation.CacheEvict;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
+import org.springframework.lang.NonNull;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
|
import java.util.List;
|
|
|
@@ -18,6 +20,10 @@ public interface UserRepo extends JpaRepository<User, Long>, JpaSpecificationExe
|
|
|
@Query("update User u set u.del = true where u.id = ?1")
|
|
|
void softDelete(Long id);
|
|
|
|
|
|
+ @CacheEvict(value = "user", key = "#user.username")
|
|
|
+ @NonNull
|
|
|
+ User save(@NonNull User user);
|
|
|
+
|
|
|
@Cacheable("user")
|
|
|
User findByUsernameAndDelFalse(String username);
|
|
|
|