Class TopicStore

All Implemented Interfaces:
IndexingStore

public class TopicStore extends AbstractIndexingStore<Topic>
The class TopicStore contains the repository for topics.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TopicStore(org.hibernate.SessionFactory sessionFactory, IndexingSession indexingSession)
    This is the constructor for the TopicStore.
  • Method Summary

    Modifier and Type
    Method
    Description
    findAllByKeyStartingWith(@NonNull String pattern)
    The method findAllByNameStartingWith provides means to retrieve topics where the sort text is starting with a given string.
    getByKey(@NonNull String key)
    The method getByKey provides means to find an topic by its key.
    protected jakarta.persistence.criteria.Root<Topic>
    listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Topic> query)
    The method listQuery provides means to construct a query for the list of entities for a search.
    protected List<Map<String,Object>>
    map(List<Topic> list)
    The method map provides means to format a list for external use.

    Methods inherited from class org.ctan.site.stores.base.AbstractIndexingStore

    count, findAll, remove, save, updateIndex

    Methods inherited from class org.ctan.site.stores.base.AbstractStore

    getById, list, remove, remove

    Methods inherited from class io.dropwizard.hibernate.AbstractDAO

    criteriaQuery, currentSession, get, getEntityClass, initialize, list, list, namedQuery, namedTypedQuery, persist, query, uniqueResult, uniqueResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TopicStore

      public TopicStore(org.hibernate.SessionFactory sessionFactory, IndexingSession indexingSession)
      This is the constructor for the TopicStore.
      Parameters:
      sessionFactory - the session factory
      indexingSession - the indexing session
  • Method Details

    • findAllByKeyStartingWith

      public List<Topic> findAllByKeyStartingWith(@NonNull @NonNull String pattern)
      The method findAllByNameStartingWith provides means to retrieve topics where the sort text is starting with a given string. The comparison is done case-insensitive.
      Parameters:
      pattern - the initial segment
      Returns:
      the list of topics ordered by the sort text
    • getByKey

      public Topic getByKey(@NonNull @NonNull String key)
      The method getByKey provides means to find an topic by its key.
      Parameters:
      key - the (non-null) key
      Returns:
      the topic or null
    • listQuery

      protected jakarta.persistence.criteria.Root<Topic> listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Topic> query)
      The method listQuery provides means to construct a query for the list of entities for a search.
      Specified by:
      listQuery in class AbstractStore<Topic>
      Parameters:
      term - the search term
      cb - the criteria builder
      query - the query
      Returns:
      the root
      See Also:
    • map

      protected List<Map<String,Object>> map(List<Topic> list)
      The method map provides means to format a list for external use.
      Specified by:
      map in class AbstractStore<Topic>
      Parameters:
      list - the list of entries
      Returns:
      the formatted list
      See Also: