Package org.ctan.site.stores
Class PkgStore
java.lang.Object
io.dropwizard.hibernate.AbstractDAO<Pkg>
- All Implemented Interfaces:
IndexingStore
The class
PkgStore
contains the repository for authors.-
Constructor Summary
ConstructorsConstructorDescriptionPkgStore
(org.hibernate.SessionFactory sessionFactory, IndexingSession indexingSession) This is the constructor for thePkgStore
. -
Method Summary
Modifier and TypeMethodDescriptioncount()
The methodcount
provides means to count the entities in the database.findAll()
The methodfindAll
collects all packages.The methodfindAllByKeyStartingWith
collects all packages where the key has a given prefix.The methodfindAllByNameStartingWith
collects all packages where the name has a given prefix.getByCtanPath
(String path) The methodgetByCtanPath
provides means to retrieve a package by its CTAN location.The methodgetByKey
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 methodlistQuery
provides means to construct a query for the list of entities for a search.The methodmap
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
-
Constructor Details
-
PkgStore
This is the constructor for thePkgStore
.- Parameters:
sessionFactory
- the session factoryindexingSession
- the indexing session
-
-
Method Details
-
count
The methodcount
provides means to count the entities in the database.- Overrides:
count
in classAbstractIndexingStore<Pkg>
- Returns:
- the total number of entities
-
findAll
The methodfindAll
collects all packages.- Overrides:
findAll
in classAbstractIndexingStore<Pkg>
- Returns:
- a list of packages
-
findAllByKeyStartingWith
The methodfindAllByKeyStartingWith
collects all packages where the key has a given prefix.- Parameters:
s
- the prefix ornull
- Returns:
- the list of matching packages
-
findAllByNameStartingWith
The methodfindAllByNameStartingWith
collects all packages where the name has a given prefix.- Parameters:
s
- the prefix ornull
- Returns:
- the list of matching packages
-
getByCtanPath
The methodgetByCtanPath
provides means to retrieve a package by its CTAN location.- Parameters:
path
- the CTAN path- Returns:
- the package or
null
-
getByKey
The methodgetByKey
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 methodlistQuery
provides means to construct a query for the list of entities for a search.- Specified by:
listQuery
in classAbstractStore<Pkg>
- Parameters:
term
- the search termcb
- the criteria builderquery
- the query- Returns:
- the root
- See Also:
-
map
The methodmap
provides means to format a list for external use.- Specified by:
map
in classAbstractStore<Pkg>
- Parameters:
list
- the list of entries- Returns:
- the formatted list
- See Also:
-