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 methodfindAllprovides means to collect all mirrors from the database.The methodfindAllByNameStartingWithprovides means to retrieve mirrors where the sort text is starting with a given string.getByHostname(String key) The methodgetByHostnameprovides 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 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, remove, save, updateIndexMethods inherited from class org.ctan.site.stores.base.AbstractStore
getById, list, removeMethods 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 methodfindAllprovides means to collect all mirrors from the database.- Overrides:
findAllin classAbstractIndexingStore<Mirrors>- Returns:
- the list of mirrors
-
findAllByKeyStartingWith
The methodfindAllByNameStartingWithprovides 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 methodgetByHostnameprovides 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 methodlistQueryprovides means to construct a query for the list of entities for a search.- Specified by:
listQueryin classAbstractStore<Mirrors>- 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<Mirrors>- Parameters:
list- the list of entries- Returns:
- the formatted list
- See Also:
-