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 methodfindAllByKeyOrNameContainingprovides means to search for packages.The methodfindAllByKeyStartingWithcollects all packages where the key has a given prefix.getByCtanPath(@NonNull String path) The methodgetByCtanPathprovides means to retrieve a package by its CTAN location.The methodgetByKeyprovides means to retrieve a package by its key.protected IndexTypeThe methodindexTypeprovides means to retrieve the index type.The methodlistprovides 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 methodlistQueryprovides means to construct a query for the list of entities for a search.The methodmapprovides means to format a list for external use.The methodsetprovides means to set a single attribute and save the instance.Methods inherited from class org.ctan.site.stores.base.AbstractIndexingStore
count, remove, remove, save, updateIndexMethods inherited from class org.ctan.site.stores.base.AbstractStore
get, 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
-
findAllByKeyOrNameContaining
The methodfindAllByKeyOrNameContainingprovides means to search for packages.- Parameters:
s- the string contained in the key or name- Returns:
- the list of packages ordered by the key
-
findAllByKeyStartingWith
The methodfindAllByKeyStartingWithcollects all packages where the key 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:
key- the key- Returns:
- the package or
null
-
list
The methodlistprovides means to extract a page of items.- Overrides:
listin classAbstractStore<Pkg>- Parameters:
term- the search termpage- the current pagepageSize- the page sizeorderBy- the orderasc- the indicator for ascending- Returns:
- the paged results
-
set
The methodsetprovides means to set a single attribute and save the instance.- Parameters:
pkg- the key of the packagekey- the keyvalue- the new value- Returns:
- the package instance
-
indexType
The methodindexTypeprovides means to retrieve the index type.- Specified by:
indexTypein classAbstractIndexingStore<Pkg>- Returns:
- the index type
- See Also:
-
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:
-