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 TypeMethodDescriptionfindAll()The methodfindAllcollects all packages.The methodfindAllByKeyStartingWithcollects all packages where the key has a given prefix.The methodfindAllByNameStartingWithcollects all packages where the name has a given prefix.getByCtanPath(String path) The methodgetByCtanPathprovides means to retrieve a package by its CTAN location.The methodgetByKeyprovides 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 methodlistQueryprovides means to construct a query for the list of entities for a search.The methodmapprovides means to format a list for external use.Methods inherited from class org.ctan.site.stores.base.AbstractIndexingStore
count, remove, save, updateIndexMethods inherited from class org.ctan.site.stores.base.AbstractStore
getById, list, remove, removeMethods 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
-
findAll
The methodfindAllcollects all packages.- Overrides:
findAllin classAbstractIndexingStore<Pkg>- Returns:
- a list of packages
-
findAllByKeyStartingWith
The methodfindAllByKeyStartingWithcollects all packages where the key has a given prefix.- Parameters:
s- the prefix ornull- Returns:
- the list of matching packages
-
findAllByNameStartingWith
The methodfindAllByNameStartingWithcollects all packages where the name has a given prefix.- Parameters:
s- the prefix ornull- Returns:
- the list of matching packages
-
getByCtanPath
The methodgetByCtanPathprovides means to retrieve a package by its CTAN location.- Parameters:
path- the CTAN path- Returns:
- the package or
null
-
getByKey
The methodgetByKeyprovides 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 methodlistQueryprovides means to construct a query for the list of entities for a search.- Specified by:
listQueryin classAbstractStore<Pkg>- Parameters:
term- the search termcb- the criteria builderquery- the query- Returns:
- the root
- See Also:
-
map
The methodmapprovides means to format a list for external use.- Specified by:
mapin classAbstractStore<Pkg>- Parameters:
list- the list of entries- Returns:
- the formatted list
- See Also:
-