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 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 IndexType
    The method indexType provides means to retrieve the index type.
    list(String term, int page, int pageSize, String orderBy, boolean asc)
    The method list provides means to extract a page of items.
    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.
    set(@NonNull String pkg, String key, String value)
    The method set provides means to set a single attribute and save the instance.

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

    count, remove, remove, save, updateIndex

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

    get, 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

    • 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
    • indexType

      protected IndexType indexType()
      The method indexType provides means to retrieve the index type.
      Specified by:
      indexType in class AbstractIndexingStore<Pkg>
      Returns:
      the index type
      See Also:
    • list

      public GeneralPage list(String term, int page, int pageSize, String orderBy, boolean asc)
      The method list provides means to extract a page of items.
      Overrides:
      list in class AbstractStore<Pkg>
      Parameters:
      term - the search term
      page - the current page
      pageSize - the page size
      orderBy - the order
      asc - the indicator for ascending
      Returns:
      the paged results
    • 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:
    • set

      public Pkg set(@NonNull @NonNull String pkg, String key, String value)
      The method set provides means to set a single attribute and save the instance.
      Parameters:
      pkg - the key of the package
      key - the key
      value - the new value
      Returns:
      the package instance