Package org.ctan.site.stores
Class TopicStore
java.lang.Object
io.dropwizard.hibernate.AbstractDAO<Topic>
- All Implemented Interfaces:
IndexingStore
The class
TopicStore contains the repository for topics.-
Constructor Summary
ConstructorsConstructorDescriptionTopicStore(org.hibernate.SessionFactory sessionFactory, IndexingSession indexingSession) This is the constructor for theTopicStore. -
Method Summary
Modifier and TypeMethodDescriptionfindAllByKeyOrTitleContaining(String s, String locale) The methodfindAllByKeyOrTitleContainingprovides means to search for topics.findAllByKeyStartingWith(@NonNull String pattern) The methodfindAllByKeyStartingWithprovides means to retrieve topics where the sort text is starting with a given string.The methodgetByKeyprovides means to find an topic by its key.protected IndexTypeThe methodindexTypeprovides means to retrieve the index type.protected jakarta.persistence.criteria.Root<Topic> listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Topic> 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, findAll, remove, remove, save, updateIndexMethods inherited from class org.ctan.site.stores.base.AbstractStore
get, list, removeMethods inherited from class io.dropwizard.hibernate.AbstractDAO
criteriaQuery, currentSession, get, getEntityClass, initialize, list, list, namedQuery, namedTypedQuery, persist, query, uniqueResult, uniqueResult
-
Constructor Details
-
TopicStore
This is the constructor for theTopicStore.- Parameters:
sessionFactory- the session factoryindexingSession- the indexing session
-
-
Method Details
-
findAllByKeyOrTitleContaining
The methodfindAllByKeyOrTitleContainingprovides means to search for topics.- Parameters:
s- the string contained in the namelocale- the language- Returns:
- the list of licenses ordered by the key
-
findAllByKeyStartingWith
The methodfindAllByKeyStartingWithprovides means to retrieve topics where the sort text is starting with a given string. The comparison is done case-insensitive.- Parameters:
pattern- the initial segment- Returns:
- the list of topics ordered by the sort text
-
getByKey
The methodgetByKeyprovides means to find an topic by its key.- Parameters:
key- the (non-null) key- Returns:
- the topic or
null
-
indexType
The methodindexTypeprovides means to retrieve the index type.- Specified by:
indexTypein classAbstractIndexingStore<Topic>- Returns:
- the index type
- See Also:
-
listQuery
protected jakarta.persistence.criteria.Root<Topic> listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Topic> query) The methodlistQueryprovides means to construct a query for the list of entities for a search.- Specified by:
listQueryin classAbstractStore<Topic>- 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<Topic>- Parameters:
list- the list of entries- Returns:
- the formatted list
- See Also:
-