Class UserServiceImpl
java.lang.Object
com.foreach.across.modules.user.services.UserServiceImpl
- All Implemented Interfaces:
UserService
,org.springframework.data.querydsl.QuerydslPredicateExecutor<User>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
count
(com.querydsl.core.types.Predicate predicate) void
delete
(long userId) void
deleteProperties
(long userId) void
deleteProperties
(User user) boolean
exists
(com.querydsl.core.types.Predicate predicate) findAll
(com.querydsl.core.types.OrderSpecifier<?>... orders) findAll
(com.querydsl.core.types.Predicate predicate) findAll
(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) org.springframework.data.domain.Page<User>
findAll
(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Pageable pageable) findAll
(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Sort sort) <S extends User,
R>
RfindBy
(com.querydsl.core.types.Predicate predicate, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>, R> queryFunction) findOne
(com.querydsl.core.types.Predicate predicate) getProperties
(User user) getUserByEmail
(String email) getUserByEmail
(String email, UserDirectory userDirectory) getUserById
(long id) getUserByUsername
(String username) getUserByUsername
(String username, UserDirectory userDirectory) getUsers()
getUsersWithPropertyValue
(String propertyName, Object propertyValue) void
saveProperties
(UserProperties userProperties)
-
Constructor Details
-
UserServiceImpl
public UserServiceImpl()
-
-
Method Details
-
getUsers
- Specified by:
getUsers
in interfaceUserService
-
getUserById
@Cacheable(value="securityPrincipalCache", unless="true && (#result instanceof T(java.util.Optional) && #result.isPresent() ) || (not (#result instanceof T(java.util.Optional)) && #result != null)") public Optional<User> getUserById(long id) - Specified by:
getUserById
in interfaceUserService
-
getUserByEmail
@Cacheable(value="userCache", key="(\'email:\' + #email).toLowerCase()", unless="true && (#result instanceof T(java.util.Optional) && #result.isPresent() ) || (not (#result instanceof T(java.util.Optional)) && #result != null)") public Optional<User> getUserByEmail(String email) - Specified by:
getUserByEmail
in interfaceUserService
-
getUserByEmail
- Specified by:
getUserByEmail
in interfaceUserService
-
getUserByUsername
- Specified by:
getUserByUsername
in interfaceUserService
-
getUserByUsername
@Cacheable(value="userCache", key="(\'username:\' + #username).toLowerCase()", unless="true && (#result instanceof T(java.util.Optional) && #result.isPresent() ) || (not (#result instanceof T(java.util.Optional)) && #result != null)") public Optional<User> getUserByUsername(String username) - Specified by:
getUserByUsername
in interfaceUserService
-
save
- Specified by:
save
in interfaceUserService
-
delete
@Transactional("jpaTransactionManager") public void delete(long userId) - Specified by:
delete
in interfaceUserService
-
deleteProperties
- Specified by:
deleteProperties
in interfaceUserService
-
deleteProperties
public void deleteProperties(long userId) - Specified by:
deleteProperties
in interfaceUserService
-
getProperties
- Specified by:
getProperties
in interfaceUserService
-
saveProperties
- Specified by:
saveProperties
in interfaceUserService
-
getUsersWithPropertyValue
@Transactional(value="jpaTransactionManager", readOnly=true) public Collection<User> getUsersWithPropertyValue(String propertyName, Object propertyValue) - Specified by:
getUsersWithPropertyValue
in interfaceUserService
-
findAll
- Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<User>
- Specified by:
findAll
in interfaceUserService
-
findAll
public Iterable<User> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Sort sort) - Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<User>
- Specified by:
findAll
in interfaceUserService
-
findOne
- Specified by:
findOne
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<User>
- Specified by:
findOne
in interfaceUserService
-
findAll
public Collection<User> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) - Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<User>
- Specified by:
findAll
in interfaceUserService
-
findAll
- Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<User>
- Specified by:
findAll
in interfaceUserService
-
findAll
public org.springframework.data.domain.Page<User> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Pageable pageable) - Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<User>
- Specified by:
findAll
in interfaceUserService
-
count
public long count(com.querydsl.core.types.Predicate predicate) - Specified by:
count
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<User>
- Specified by:
count
in interfaceUserService
-
exists
public boolean exists(com.querydsl.core.types.Predicate predicate) - Specified by:
exists
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<User>
- Specified by:
exists
in interfaceUserService
-
findBy
public <S extends User,R> R findBy(com.querydsl.core.types.Predicate predicate, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>, R> queryFunction) - Specified by:
findBy
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<User>
-