Package org.ctan.site.stores
Class LicenseStore
java.lang.Object
io.dropwizard.hibernate.AbstractDAO<License>
- All Implemented Interfaces:
IndexingStore
The class
LicenseStore
contains the repository for licenses.-
Constructor Summary
ConstructorsConstructorDescriptionLicenseStore
(org.hibernate.SessionFactory sessionFactory, IndexingSession indexingSession) This is the constructor for theAuthorStore
. -
Method Summary
Modifier and TypeMethodDescriptioncount()
The methodcount
provides means to count the entities in the database.The methodfindAllByKeyOrNameStartingWith
provides means to retrieve licenses where the sort text is starting with a given string.The methodfindAllByKeyStartingWith
provides means to retrieve licenses where the sort text is starting with a given string.The methodgetByKey
provides means to find an license by its key.protected jakarta.persistence.criteria.Root
<License> listQuery
(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<License> 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
findAll, 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
-
LicenseStore
This is the constructor for theAuthorStore
.- 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<License>
- Returns:
- the total number of entities
-
findAllByKeyOrNameStartingWith
The methodfindAllByKeyOrNameStartingWith
provides means to retrieve licenses 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
-
findAllByKeyStartingWith
The methodfindAllByKeyStartingWith
provides means to retrieve licenses 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
-
getByKey
The methodgetByKey
provides means to find an license by its key.- Parameters:
key
- the key- Returns:
- the license or
null
-
listQuery
protected jakarta.persistence.criteria.Root<License> listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<License> query) The methodlistQuery
provides means to construct a query for the list of entities for a search.- Specified by:
listQuery
in classAbstractStore<License>
- 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<License>
- Parameters:
list
- the list of entries- Returns:
- the formatted list
- See Also:
-