Class UserServiceImpl

java.lang.Object
com.foreach.across.modules.user.services.UserServiceImpl
All Implemented Interfaces:
UserService, org.springframework.data.querydsl.QuerydslPredicateExecutor<User>

@Service public class UserServiceImpl extends Object implements UserService
  • Constructor Details

    • UserServiceImpl

      public UserServiceImpl()
  • Method Details

    • getUsers

      public Collection<User> getUsers()
      Specified by:
      getUsers in interface UserService
    • 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 interface UserService
    • 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 interface UserService
    • getUserByEmail

      public Optional<User> getUserByEmail(String email, UserDirectory userDirectory)
      Specified by:
      getUserByEmail in interface UserService
    • getUserByUsername

      public Optional<User> getUserByUsername(String username, UserDirectory userDirectory)
      Specified by:
      getUserByUsername in interface UserService
    • 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 interface UserService
    • save

      @Transactional("jpaTransactionManager") public User save(User userDto)
      Specified by:
      save in interface UserService
    • delete

      @Transactional("jpaTransactionManager") public void delete(long userId)
      Specified by:
      delete in interface UserService
    • deleteProperties

      public void deleteProperties(User user)
      Specified by:
      deleteProperties in interface UserService
    • deleteProperties

      public void deleteProperties(long userId)
      Specified by:
      deleteProperties in interface UserService
    • getProperties

      public UserProperties getProperties(User user)
      Specified by:
      getProperties in interface UserService
    • saveProperties

      public void saveProperties(UserProperties userProperties)
      Specified by:
      saveProperties in interface UserService
    • getUsersWithPropertyValue

      @Transactional(value="jpaTransactionManager", readOnly=true) public Collection<User> getUsersWithPropertyValue(String propertyName, Object propertyValue)
      Specified by:
      getUsersWithPropertyValue in interface UserService
    • findAll

      public Collection<User> findAll(com.querydsl.core.types.Predicate predicate)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<User>
      Specified by:
      findAll in interface UserService
    • findAll

      public Iterable<User> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Sort sort)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<User>
      Specified by:
      findAll in interface UserService
    • findOne

      public Optional<User> findOne(com.querydsl.core.types.Predicate predicate)
      Specified by:
      findOne in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<User>
      Specified by:
      findOne in interface UserService
    • findAll

      public Collection<User> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<User>
      Specified by:
      findAll in interface UserService
    • findAll

      public Iterable<User> findAll(com.querydsl.core.types.OrderSpecifier<?>... orders)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<User>
      Specified by:
      findAll in interface UserService
    • 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 interface org.springframework.data.querydsl.QuerydslPredicateExecutor<User>
      Specified by:
      findAll in interface UserService
    • count

      public long count(com.querydsl.core.types.Predicate predicate)
      Specified by:
      count in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<User>
      Specified by:
      count in interface UserService
    • exists

      public boolean exists(com.querydsl.core.types.Predicate predicate)
      Specified by:
      exists in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<User>
      Specified by:
      exists in interface UserService
    • 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 interface org.springframework.data.querydsl.QuerydslPredicateExecutor<User>