java.lang.Object
org.silverpeas.core.persistence.datasource.repository.jpa.AbstractJpaEntityRepository<Reply>
org.silverpeas.core.persistence.datasource.repository.jpa.BasicJpaEntityRepository<Reply>
org.silverpeas.components.questionreply.repository.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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    countByQuestion(long questionId)
    Counts the replies to the specified question.
    int
    countPrivateByQuestion(long questionId)
    Counts the private replies to the specified question.
    int
    countPublicByQuestion(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.
    getById(long replyId, String instanceId)
    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, saveAndFlush

    Methods 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, updateFromNamedQuery

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.silverpeas.core.persistence.datasource.repository.EntityRepository

    delete, deleteById, getById, save, save
  • Constructor Details

    • ReplyRepository

      public ReplyRepository()
  • Method Details

    • getById

      public Reply getById(long replyId, String instanceId)
      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

      public List<Reply> getById(Collection<Integer> replyIds, long questionId)
      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

      public List<Reply> findByQuestion(long questionId, String instanceId)
      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

      public List<Reply> findPublicByQuestion(long questionId, String instanceId)
      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

      public List<Reply> findPrivateByQuestion(long questionId, String instanceId)
      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.