Package org.ctan.site.stores
Class AuthorStore
java.lang.Object
io.dropwizard.hibernate.AbstractDAO<Author>
- All Implemented Interfaces:
IndexingStore
The class
AuthorStore
contains the repository for authors.-
Constructor Summary
ConstructorsConstructorDescriptionAuthorStore
(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.findAll()
The methodfindAll
provides means to retrieve authors.The methodfindAllByKeyStartingWith
provides means to retrieve authors where the key is starting with a given string.The methodfindAllByNameContaining
provides means to search for authors.The methodfindAllByNameStartingWith
provides means to retrieve authors where the sort text is starting with a given string.getByEmail
(String email) The methodgetByEmail
provides means to find an author by it email address.The methodgetByKey
provides means to find an author by its key.The methodlist
provides means to extract a page of items.protected jakarta.persistence.criteria.Root
<Author> listQuery
(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Author> 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.The methodset
provides means to set a single attribute to a new value.Methods inherited from class org.ctan.site.stores.base.AbstractIndexingStore
remove, save, updateIndex
Methods inherited from class org.ctan.site.stores.base.AbstractStore
getById, 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
-
AuthorStore
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<Author>
- Returns:
- the total number of entities
-
findAll
The methodfindAll
provides means to retrieve authors.- Overrides:
findAll
in classAbstractIndexingStore<Author>
- Returns:
- the list of authors sorted by key
-
findAllByKeyStartingWith
The methodfindAllByKeyStartingWith
provides means to retrieve authors where the key is starting with a given string. The comparison is done case-insensitive.- Parameters:
s
- the initial segment- Returns:
- the list of authors ordered by the key
-
findAllByNameContaining
The methodfindAllByNameContaining
provides means to search for authors.- Parameters:
s
- the string contained in the name- Returns:
- the list of authors ordered by the key
-
findAllByNameStartingWith
The methodfindAllByNameStartingWith
provides means to retrieve authors 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 authors ordered by the sort text
-
getByEmail
The methodgetByEmail
provides means to find an author by it email address.- Parameters:
email
- the email address- Returns:
- the author or
null
-
getByKey
The methodgetByKey
provides means to find an author by its key.- Parameters:
key
- the key- Returns:
- the author or
null
-
list
The methodlist
provides means to extract a page of items.- Overrides:
list
in classAbstractStore<Author>
- Parameters:
term
- the search termpage
- the current pagepageSize
- the page sizeorderBy
- the orderasc
- the indicator for ascending- Returns:
- the paged results
-
listQuery
protected jakarta.persistence.criteria.Root<Author> listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Author> query) The methodlistQuery
provides means to construct a query for the list of entities for a search.- Specified by:
listQuery
in classAbstractStore<Author>
- 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<Author>
- Parameters:
list
- the list of entries- Returns:
- the formatted list
- See Also:
-
set
The methodset
provides means to set a single attribute to a new value.- Parameters:
key
- the keyattribute
- the attribute namevalue
- the attribute value- Returns:
true
iff the change has been saved
-