Interface PublicDocumentLinkDAO
- All Superinterfaces:
org.springframework.data.repository.Repository<PublicDocumentAccessEntity, Long>
public interface PublicDocumentLinkDAO
extends org.springframework.data.repository.Repository<PublicDocumentAccessEntity, Long>
Walks the platform's public links: the rows are read by keyset on their
identifier and deleted one by one, without loading any entity into the
persistence context
-
Method Summary
Modifier and TypeMethodDescriptionintdeleteLink(long id) booleanexistsById(Long id) List<org.exoplatform.documents.model.PublicDocumentLink> findLinksAfter(long lastId, org.springframework.data.domain.Limit limit)
-
Method Details
-
findLinksAfter
@Query("SELECT new org.exoplatform.documents.model.PublicDocumentLink(p.id, p.nodeId) FROM PublicDocumentAccess p WHERE p.id > :lastId ORDER BY p.id ASC") List<org.exoplatform.documents.model.PublicDocumentLink> findLinksAfter(@Param("lastId") long lastId, org.springframework.data.domain.Limit limit) - Parameters:
lastId- the identifier of the last link already read, 0 to startlimit- the maximum count of links to read- Returns:
- the links whose identifier is greater than
lastId, in ascending identifier order
-
existsById
- Parameters:
id- a link's identifier- Returns:
- true when a link still has this identifier
-
deleteLink
@Transactional @Modifying @Query("DELETE FROM PublicDocumentAccess p WHERE p.id = :id") int deleteLink(@Param("id") long id) - Parameters:
id- a link's identifier- Returns:
- the count of links deleted: 0 when no link has this identifier any more
-