|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.persistence.CommentRepositoryImpl
public class CommentRepositoryImpl
JPA implementation of a comment repository.
Constructor Summary | |
---|---|
CommentRepositoryImpl(javax.persistence.EntityManager em)
Constructor. |
|
CommentRepositoryImpl(ccc.persistence.Repository repo)
Constructor. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommentRepositoryImpl(ccc.persistence.Repository repo)
repo
- The repository used to perform queries.public CommentRepositoryImpl(javax.persistence.EntityManager em)
em
- The JPA entity manager for this repository.Method Detail |
---|
public void create(CommentEntity comment)
create
in interface CommentRepository
comment
- The comment to persist.public void delete(java.util.UUID commentId)
delete
in interface CommentRepository
commentId
- The ID of the comment to delete.public CommentEntity retrieve(java.util.UUID commentId)
retrieve
in interface CommentRepository
commentId
- The ID of the comment to retrieve.
public java.util.List<CommentEntity> list(ResourceEntity resource, CommentStatus status, java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
list
in interface CommentRepository
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.
public long count(ResourceEntity resource, CommentStatus status)
count
in interface CommentRepository
resource
- Filter comments by resource. NULL will return all.status
- Filter comments based on status. NULL will return all.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |