Skip to content

Commit bc6f571

Browse files
Evict user login cache for couchbase (#28039)
* Isue #27972 last tests fix * Isue #27972 last tests fix * Isue #27972 last tests fix
1 parent a137788 commit bc6f571

File tree

1 file changed

+6
-0
lines changed
  • generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service

1 file changed

+6
-0
lines changed

generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/UserService.java.ejs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ import org.slf4j.LoggerFactory;
5454
<%_ } _%>
5555
<%_ if (cacheProviderAny) { _%>
5656
import org.springframework.cache.CacheManager;
57+
<%_ if (databaseTypeCouchbase) { _%>
58+
import org.springframework.cache.annotation.CacheEvict;
59+
<%_ } _%>
5760
<%_ } _%>
5861
<%_ if (databaseTypeSql || databaseTypeMongodb || databaseTypeNeo4j || databaseTypeCouchbase) { _%>
5962
<%_ if (!reactive) { _%>
@@ -573,6 +576,9 @@ public class UserService {
573576
.map(<%= user.adminUserDto %>::new);
574577
}
575578
579+
<%_ if (databaseTypeCouchbase && cacheProviderAny) { _%>
580+
@CacheEvict(cacheNames = UserRepository.USERS_BY_LOGIN_CACHE, key = "#login")
581+
<%_ } _%>
576582
<%_ if (reactive) { _%>
577583
<%_ if (databaseTypeSql) { _%>
578584
@Transactional

0 commit comments

Comments
 (0)