ccc.persistence
Interface CommentRepository

All Known Implementing Classes:
CommentRepositoryImpl

public interface CommentRepository

Repository for comments.

Author:
Civic Computing Ltd.

Method Summary
 long count(ResourceEntity resource, CommentStatus status)
          Count existing comments.
 void create(CommentEntity comment)
          Persist a newly created comment.
 void delete(java.util.UUID commentId)
          Delete a comment.
 java.util.List<CommentEntity> list(ResourceEntity resource, CommentStatus status, java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
          List existing comments.
 CommentEntity retrieve(java.util.UUID commentId)
          Retrieve a single comment.
 

Method Detail

create

void create(CommentEntity comment)
Persist a newly created comment.

Parameters:
comment - The comment to persist.

delete

void delete(java.util.UUID commentId)
Delete a comment.

Parameters:
commentId - The ID of the comment to delete.

retrieve

CommentEntity retrieve(java.util.UUID commentId)
Retrieve a single comment.

Parameters:
commentId - The ID of the comment to retrieve.
Returns:
The corresponding comment.

list

java.util.List<CommentEntity> list(ResourceEntity resource,
                                   CommentStatus status,
                                   java.lang.String sort,
                                   SortOrder sortOrder,
                                   int pageNo,
                                   int pageSize)
List existing comments.

Parameters:
resource - Filter comments by resource. NULL will return all.
status - Filter comments based on status. NULL will return all.
sort - The field to sort on.
sortOrder - The order results be sorted in.
pageNo - The page of results to return.
pageSize - The number of results in a page.
Returns:
A list of comments.

count

long count(ResourceEntity resource,
           CommentStatus status)
Count existing comments.

Parameters:
resource - Filter comments by resource. NULL will return all.
status - Filter comments based on status. NULL will return all.
Returns:
The number of comments.


Copyright © 2010. All Rights Reserved.