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 TypeMethodDescriptionfindAll()The methodfindAllprovides means to retrieve authors.The methodfindAllByKeyStartingWithprovides means to retrieve authors where the key is starting with a given string.The methodfindAllByNameContainingprovides means to search for authors.The methodfindAllByNameStartingWithprovides means to retrieve authors where the sort text is starting with a given string.getByEmail(String email) The methodgetByEmailprovides means to find an author by it email address.The methodgetByKeyprovides means to find an author by its key.The methodlistprovides 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 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 to a new value.Methods inherited from class org.ctan.site.stores.base.AbstractIndexingStore
count, remove, save, updateIndexMethods inherited from class org.ctan.site.stores.base.AbstractStore
getById, remove, removeMethods 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
-
findAll
The methodfindAllprovides means to retrieve authors.- Overrides:
findAllin classAbstractIndexingStore<Author>- Returns:
- the list of authors sorted by key
-
findAllByKeyStartingWith
The methodfindAllByKeyStartingWithprovides 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 methodfindAllByNameContainingprovides means to search for authors.- Parameters:
s- the string contained in the name- Returns:
- the list of authors ordered by the key
-
findAllByNameStartingWith
The methodfindAllByNameStartingWithprovides 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 methodgetByEmailprovides means to find an author by it email address.- Parameters:
email- the email address- Returns:
- the author or
null
-
getByKey
The methodgetByKeyprovides means to find an author by its key.- Parameters:
key- the key- Returns:
- the author or
null
-
list
The methodlistprovides means to extract a page of items.- Overrides:
listin 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 methodlistQueryprovides means to construct a query for the list of entities for a search.- Specified by:
listQueryin classAbstractStore<Author>- 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<Author>- Parameters:
list- the list of entries- Returns:
- the formatted list
- See Also:
-
set
The methodsetprovides means to set a single attribute to a new value.- Parameters:
key- the keyattribute- the attribute namevalue- the attribute value- Returns:
trueiff the change has been saved
-