Package org.ctan.site.stores
Class MirrorStore
java.lang.Object
io.dropwizard.hibernate.AbstractDAO<Mirrors>
- All Implemented Interfaces:
IndexingStore
The class
MirrorStore
contains the repository for mirrors.-
Constructor Summary
ConstructorsConstructorDescriptionMirrorStore
(@NonNull org.hibernate.SessionFactory sessionFactory, @NonNull IndexingSession indexingSession) This is the constructor for theMirrorStore
. -
Method Summary
Modifier and TypeMethodDescriptionfindAll()
The methodfindAll
provides means to collect all mirrors from the database.The methodfindAllByNameStartingWith
provides means to retrieve mirrors where the sort text is starting with a given string.getByHostname
(String key) The methodgetByHostname
provides means to find a mirror by its name.protected jakarta.persistence.criteria.Root
<Mirrors> listQuery
(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Mirrors> 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
count, 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
-
MirrorStore
public MirrorStore(@NonNull @NonNull org.hibernate.SessionFactory sessionFactory, @NonNull @NonNull IndexingSession indexingSession) This is the constructor for theMirrorStore
.- Parameters:
sessionFactory
- the session factoryindexingSession
- the indexing session
-
-
Method Details
-
findAll
The methodfindAll
provides means to collect all mirrors from the database.- Overrides:
findAll
in classAbstractIndexingStore<Mirrors>
- Returns:
- the list of mirrors
-
findAllByKeyStartingWith
The methodfindAllByNameStartingWith
provides means to retrieve mirrors where the sort text is starting with a given string. The comparison is done case-insensitive.- Parameters:
s
- the initial segment- Returns:
- the list of licenses ordered by the sort text
-
getByHostname
The methodgetByHostname
provides means to find a mirror by its name.- Parameters:
key
- the key- Returns:
- the license or
null
-
listQuery
protected jakarta.persistence.criteria.Root<Mirrors> listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Mirrors> query) The methodlistQuery
provides means to construct a query for the list of entities for a search.- Specified by:
listQuery
in classAbstractStore<Mirrors>
- 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<Mirrors>
- Parameters:
list
- the list of entries- Returns:
- the formatted list
- See Also:
-