Class GroupServiceImpl
java.lang.Object
com.foreach.across.modules.user.services.GroupServiceImpl
- All Implemented Interfaces:
GroupService
,org.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
- Author:
- Arne Vandamme
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
count
(com.querydsl.core.types.Predicate predicate) void
delete
(long groupId) void
deleteProperties
(long groupId) void
deleteProperties
(Group group) 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<Group>
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 Group,
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) getGroupById
(long id) getGroupByName
(String name) Get the group with a given name in the default directory.getGroupByName
(String name, UserDirectory directory) Get the group with a given name in the specified directory.getGroupsWithPropertyValue
(String propertyName, Object propertyValue) Returns all groups having a specific property value.getProperties
(Group group) void
saveProperties
(GroupProperties groupProperties)
-
Constructor Details
-
GroupServiceImpl
public GroupServiceImpl()
-
-
Method Details
-
getGroups
- Specified by:
getGroups
in interfaceGroupService
-
getGroupById
@Cacheable(value="securityPrincipalCache", unless="true && (#result instanceof T(java.util.Optional) && #result.isPresent() ) || (not (#result instanceof T(java.util.Optional)) && #result != null)") public Optional<Group> getGroupById(long id) - Specified by:
getGroupById
in interfaceGroupService
-
getGroupByName
@Cacheable(value="groupCache", unless="true && (#result instanceof T(java.util.Optional) && #result.isPresent() ) || (not (#result instanceof T(java.util.Optional)) && #result != null)") public Optional<Group> getGroupByName(String name) Description copied from interface:GroupService
Get the group with a given name in the default directory.- Specified by:
getGroupByName
in interfaceGroupService
- Parameters:
name
- of the group- Returns:
- instance or
null
if not found
-
getGroupByName
@Cacheable(value="groupCache", key="#p0 + \':\' + #p1.id", unless="true && (#result instanceof T(java.util.Optional) && #result.isPresent() ) || (not (#result instanceof T(java.util.Optional)) && #result != null)") public Optional<Group> getGroupByName(String name, UserDirectory directory) Description copied from interface:GroupService
Get the group with a given name in the specified directory.- Specified by:
getGroupByName
in interfaceGroupService
- Parameters:
name
- of the groupdirectory
- the group should belong to- Returns:
- instance or
null
if not found
-
save
- Specified by:
save
in interfaceGroupService
-
delete
@Transactional("jpaTransactionManager") public void delete(long groupId) - Specified by:
delete
in interfaceGroupService
-
getProperties
- Specified by:
getProperties
in interfaceGroupService
-
saveProperties
- Specified by:
saveProperties
in interfaceGroupService
-
deleteProperties
- Specified by:
deleteProperties
in interfaceGroupService
-
deleteProperties
public void deleteProperties(long groupId) - Specified by:
deleteProperties
in interfaceGroupService
-
getGroupsWithPropertyValue
@Transactional(readOnly=true, value="jpaTransactionManager") public Collection<Group> getGroupsWithPropertyValue(String propertyName, Object propertyValue) Description copied from interface:GroupService
Returns all groups having a specific property value. Will return all matching groups across all user directories.- Specified by:
getGroupsWithPropertyValue
in interfaceGroupService
- Parameters:
propertyName
- name of the propertypropertyValue
- value the property should have- Returns:
- groups
-
findAll
- Specified by:
findAll
in interfaceGroupService
- Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
-
findAll
public Iterable<Group> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Sort sort) - Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
-
findAll
public Collection<Group> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) - Specified by:
findAll
in interfaceGroupService
- Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
-
findAll
- Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
-
findAll
public org.springframework.data.domain.Page<Group> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Pageable pageable) - Specified by:
findAll
in interfaceGroupService
- Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
-
count
public long count(com.querydsl.core.types.Predicate predicate) - Specified by:
count
in interfaceGroupService
- Specified by:
count
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
-
exists
public boolean exists(com.querydsl.core.types.Predicate predicate) - Specified by:
exists
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
-
findBy
public <S extends Group,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<Group>
-
findOne
- Specified by:
findOne
in interfaceGroupService
- Specified by:
findOne
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<Group>
-