Package no.nsd.qddt.domain.publication
Class PublicationServiceImpl
- java.lang.Object
-
- no.nsd.qddt.domain.publication.PublicationServiceImpl
-
- All Implemented Interfaces:
BaseService<Publication,java.util.UUID>,PublicationService
@Service("publicationService") public class PublicationServiceImpl extends java.lang.Object implements PublicationService
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description PublicationServiceImpl(PublicationRepository repository, PublicationAuditService publicationAuditService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount()voiddelete(java.util.List<Publication> instances)Deletes object with these IDs from backstore, exception raised by failure.voiddelete(java.util.UUID uuid)Deletes object with id ID from backstore, exception raised by failure.booleanexists(java.util.UUID uuid)org.springframework.data.domain.Page<Publication>findAllPageable(org.springframework.data.domain.Pageable pageable)org.springframework.data.domain.Page<Publication>findByNameOrPurposeAndStatus(java.lang.String name, java.lang.String purpose, java.lang.String publicationStatus, java.lang.String publishedKind, org.springframework.data.domain.Pageable pageable)PublicationfindOne(java.util.UUID uuid)Return a entity based on its ID.ElementRefgetDetail(ElementRef publicationElement)protected PublicationprePersistProcessing(Publication instance)Publicationsave(Publication instance)Store object T to backstore
-
-
-
Constructor Detail
-
PublicationServiceImpl
@Autowired public PublicationServiceImpl(PublicationRepository repository, PublicationAuditService publicationAuditService)
-
-
Method Detail
-
count
public long count()
- Specified by:
countin interfaceBaseService<Publication,java.util.UUID>- Returns:
- number of entities
-
exists
public boolean exists(java.util.UUID uuid)
- Specified by:
existsin interfaceBaseService<Publication,java.util.UUID>- Parameters:
uuid- ID of entity- Returns:
- true if exists
-
findOne
@PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\',\'ROLE_CONCEPT\',\'ROLE_VIEW\',\'ROLE_GUEST\')") public Publication findOne(java.util.UUID uuid)Description copied from interface:BaseServiceReturn a entity based on its ID.- Specified by:
findOnein interfaceBaseService<Publication,java.util.UUID>- Parameters:
uuid- ID of entity- Returns:
- Entity
-
save
@Transactional @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\') and hasPermission(#instance,\'AGENCY\')") public Publication save(Publication instance)Description copied from interface:BaseServiceStore object T to backstore- Specified by:
savein interfaceBaseService<Publication,java.util.UUID>- Parameters:
instance- object T- Returns:
- saved instance T (may have fields updated by backstore)
-
delete
@Transactional @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\')") public void delete(java.util.UUID uuid)Description copied from interface:BaseServiceDeletes object with id ID from backstore, exception raised by failure.- Specified by:
deletein interfaceBaseService<Publication,java.util.UUID>- Parameters:
uuid- ID of entity
-
delete
@Transactional @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\')") public void delete(java.util.List<Publication> instances)Description copied from interface:BaseServiceDeletes object with these IDs from backstore, exception raised by failure.- Specified by:
deletein interfaceBaseService<Publication,java.util.UUID>- Parameters:
instances- list of entity IDs
-
findAllPageable
@Transactional(readOnly=true) @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\',\'ROLE_CONCEPT\',\'ROLE_VIEW\',\'ROLE_GUEST\')") public org.springframework.data.domain.Page<Publication> findAllPageable(org.springframework.data.domain.Pageable pageable)- Specified by:
findAllPageablein interfacePublicationService
-
findByNameOrPurposeAndStatus
@Transactional(readOnly=true) @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\',\'ROLE_CONCEPT\',\'ROLE_VIEW\',\'ROLE_GUEST\')") public org.springframework.data.domain.Page<Publication> findByNameOrPurposeAndStatus(java.lang.String name, java.lang.String purpose, java.lang.String publicationStatus, java.lang.String publishedKind, org.springframework.data.domain.Pageable pageable)- Specified by:
findByNameOrPurposeAndStatusin interfacePublicationService
-
getDetail
@Transactional(readOnly=true) @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\',\'ROLE_CONCEPT\',\'ROLE_VIEW\',\'ROLE_GUEST\')") public ElementRef getDetail(ElementRef publicationElement)- Specified by:
getDetailin interfacePublicationService
-
prePersistProcessing
protected Publication prePersistProcessing(Publication instance)
-
-