Class ReplyRepository
- All Implemented Interfaces:
org.silverpeas.core.persistence.datasource.repository.EntityRepository<Reply>,org.silverpeas.core.persistence.datasource.repository.WithSaveAndFlush<Reply>
@Repository
public class ReplyRepository
extends org.silverpeas.core.persistence.datasource.repository.jpa.BasicJpaEntityRepository<Reply>
Repository of the replies to the questions of the FAQs. Any access to the replies is done
through their question.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountByQuestion(long questionId) Counts the replies to the specified question.intcountPrivateByQuestion(long questionId) Counts the private replies to the specified question.intcountPublicByQuestion(long questionId) Counts the public replies to the specified question.findByQuestion(long questionId, String instanceId) Finds all the replies to the specified question of the given FAQ.findPrivateByQuestion(long questionId, String instanceId) Finds the private replies to the specified question of the given FAQ.findPublicByQuestion(long questionId, String instanceId) Finds the public replies to the specified question of the given FAQ.Gets the specified reply to a question of the given FAQ.getById(Collection<Integer> replyIds, long questionId) Gets the specified replies to the given question.Methods inherited from class org.silverpeas.core.persistence.datasource.repository.jpa.BasicJpaEntityRepository
deleteByComponentInstanceId, saveAndFlushMethods inherited from class org.silverpeas.core.persistence.datasource.repository.jpa.AbstractJpaEntityRepository
contains, countByCriteria, countFromJpqlString, delete, deleteById, deleteFromJpqlQuery, deleteFromNamedQuery, findByCriteria, findByNamedQuery, findFirstByNamedQuery, flush, getAll, getById, getById, getEntityClass, getEntityManager, getFromJpqlString, getFromJpqlString, getFromNamedQuery, getFromNamedQuery, getIdentifierConverter, getMaximumItemsInClause, listFromJpqlString, listFromJpqlString, listFromJpqlString, listFromJpqlString, listFromNamedQuery, listFromNamedQuery, newNamedParameters, noParameter, save, setMaximumItemsInClause, split, streamByNamedQuery, streamByNamedQuery, streamFromJpqlString, streamFromJpqlString, updateFromJpqlQuery, updateFromNamedQueryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.silverpeas.core.persistence.datasource.repository.EntityRepository
delete, deleteById, getById, save, save
-
Constructor Details
-
ReplyRepository
public ReplyRepository()
-
-
Method Details
-
getById
Gets the specified reply to a question of the given FAQ.- Parameters:
replyId- the unique identifier of the reply.instanceId- the unique identifier of the FAQ.- Returns:
- the reply or null if no question of the FAQ has such a reply.
-
getById
Gets the specified replies to the given question. The replies to other questions are ignored.- Parameters:
replyIds- the unique identifiers of the replies.questionId- the unique identifier of the question.- Returns:
- the replies to the question among the specified ones.
-
findByQuestion
Finds all the replies to the specified question of the given FAQ.- Parameters:
questionId- the unique identifier of the question.instanceId- the unique identifier of the FAQ.- Returns:
- the replies to the question.
-
findPublicByQuestion
Finds the public replies to the specified question of the given FAQ.- Parameters:
questionId- the unique identifier of the question.instanceId- the unique identifier of the FAQ.- Returns:
- the public replies to the question.
-
findPrivateByQuestion
Finds the private replies to the specified question of the given FAQ.- Parameters:
questionId- the unique identifier of the question.instanceId- the unique identifier of the FAQ.- Returns:
- the private replies to the question.
-
countByQuestion
public int countByQuestion(long questionId) Counts the replies to the specified question.- Parameters:
questionId- the unique identifier of the question.- Returns:
- the number of replies.
-
countPublicByQuestion
public int countPublicByQuestion(long questionId) Counts the public replies to the specified question.- Parameters:
questionId- the unique identifier of the question.- Returns:
- the number of public replies.
-
countPrivateByQuestion
public int countPrivateByQuestion(long questionId) Counts the private replies to the specified question.- Parameters:
questionId- the unique identifier of the question.- Returns:
- the number of private replies.
-