Package org.ctan.site.stores
Class ArchiveFileStore
java.lang.Object
io.dropwizard.hibernate.AbstractDAO<ArchiveFile>
- All Implemented Interfaces:
IndexingStore
The class
ArchiveFileStore
contains the repository for archive
files.-
Constructor Summary
ConstructorsConstructorDescriptionArchiveFileStore
(@NonNull CtanConfiguration.TexArchiveConfig config, @NonNull org.hibernate.SessionFactory sessionFactory, @NonNull IndexingSession indexingSession) This is the constructor for theArchiveFileStore
. -
Method Summary
Modifier and TypeMethodDescriptionfindAllByPath
(String path) The methodfindAllByPath
provides means to retrieve archive files where the path is a given string.The methodfindAllByType
provides means to retrieve all items with a given type.protected jakarta.persistence.criteria.Root
<ArchiveFile> listQuery
(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<ArchiveFile> query) The methodlistQuery
provides means to construct a query for the list of entities for a search.map
(List<ArchiveFile> list) The methodmap
provides means to format a list for external use.void
The methodupdateIndex
provides means to update all entries in the database.Methods inherited from class org.ctan.site.stores.base.AbstractIndexingStore
count, findAll, remove, save
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
-
ArchiveFileStore
public ArchiveFileStore(@NonNull @NonNull CtanConfiguration.TexArchiveConfig config, @NonNull @NonNull org.hibernate.SessionFactory sessionFactory, @NonNull @NonNull IndexingSession indexingSession) This is the constructor for theArchiveFileStore
.- Parameters:
config
- the configurationsessionFactory
- the session factoryindexingSession
- the indexing session
-
-
Method Details
-
findAllByPath
The methodfindAllByPath
provides means to retrieve archive files where the path is a given string. The comparison is done case-sensitive.- Parameters:
path
- the path- Returns:
- the list of archive files ordered by the name
-
findAllByType
The methodfindAllByType
provides means to retrieve all items with a given type.- Parameters:
type
- the type- Returns:
- the list of archive files
-
listQuery
protected jakarta.persistence.criteria.Root<ArchiveFile> listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<ArchiveFile> query) The methodlistQuery
provides means to construct a query for the list of entities for a search.- Specified by:
listQuery
in classAbstractStore<ArchiveFile>
- 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<ArchiveFile>
- Parameters:
list
- the list of entries- Returns:
- the formatted list
- See Also:
-
updateIndex
The methodupdateIndex
provides means to update all entries in the database. Note that entries which are gone are not removed!- Specified by:
updateIndex
in interfaceIndexingStore
- Overrides:
updateIndex
in classAbstractIndexingStore<ArchiveFile>
- Throws:
org.apache.lucene.index.CorruptIndexException
- in case of an error in an indexIOException
- in case of an I/O error- See Also:
-