Class PkgStore

java.lang.Object
io.dropwizard.hibernate.AbstractDAO<Pkg>
All Implemented Interfaces:
IndexingStore

public class PkgStore extends AbstractIndexingStore<Pkg>
The class PkgStore contains the repository for authors.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    The method count provides means to count the entities in the database.
    The method findAll collects all packages.
    The method findAllByKeyStartingWith collects all packages where the key has a given prefix.
    The method findAllByNameStartingWith collects all packages where the name has a given prefix.
    The method getByCtanPath provides means to retrieve a package by its CTAN location.
    The method getByKey provides means to retrieve a package by its key.
    protected jakarta.persistence.criteria.Root<Pkg>
    listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Pkg> 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<Pkg> list)
    The method map provides means to format a list for external use.

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

    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

    • PkgStore

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

    • count

      public Long count()
      The method count provides means to count the entities in the database.
      Overrides:
      count in class AbstractIndexingStore<Pkg>
      Returns:
      the total number of entities
    • findAll

      public List<Pkg> findAll()
      The method findAll collects all packages.
      Overrides:
      findAll in class AbstractIndexingStore<Pkg>
      Returns:
      a list of packages
    • findAllByKeyStartingWith

      public List<Pkg> findAllByKeyStartingWith(String s)
      The method findAllByKeyStartingWith collects all packages where the key has a given prefix.
      Parameters:
      s - the prefix or null
      Returns:
      the list of matching packages
    • findAllByNameStartingWith

      public List<Pkg> findAllByNameStartingWith(String s)
      The method findAllByNameStartingWith collects all packages where the name has a given prefix.
      Parameters:
      s - the prefix or null
      Returns:
      the list of matching packages
    • getByCtanPath

      public Pkg getByCtanPath(String path)
      The method getByCtanPath provides means to retrieve a package by its CTAN location.
      Parameters:
      path - the CTAN path
      Returns:
      the package or null
    • getByKey

      public Pkg getByKey(String id)
      The method getByKey provides means to retrieve a package by its key.
      Parameters:
      id - the id
      Returns:
      the package or null
    • listQuery

      protected jakarta.persistence.criteria.Root<Pkg> listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Pkg> query)
      The method listQuery provides means to construct a query for the list of entities for a search.
      Specified by:
      listQuery in class AbstractStore<Pkg>
      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<Pkg> list)
      The method map provides means to format a list for external use.
      Specified by:
      map in class AbstractStore<Pkg>
      Parameters:
      list - the list of entries
      Returns:
      the formatted list
      See Also: