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 methodfindAllByPathprovides means to retrieve archive files where the path is a given string.The methodfindAllByTypeprovides 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 methodlistQueryprovides means to construct a query for the list of entities for a search.map(List<ArchiveFile> list) The methodmapprovides means to format a list for external use.voidThe methodupdateIndexprovides means to update all entries in the database.Methods inherited from class org.ctan.site.stores.base.AbstractIndexingStore
count, findAll, remove, remove, saveMethods inherited from class org.ctan.site.stores.base.AbstractStore
getById, list, removeMethods 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 methodfindAllByPathprovides 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 methodfindAllByTypeprovides 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 methodlistQueryprovides means to construct a query for the list of entities for a search.- Specified by:
listQueryin classAbstractStore<ArchiveFile>- 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<ArchiveFile>- Parameters:
list- the list of entries- Returns:
- the formatted list
- See Also:
-
updateIndex
The methodupdateIndexprovides means to update all entries in the database. Note that entries which are gone are not removed!- Specified by:
updateIndexin interfaceIndexingStore- Overrides:
updateIndexin 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:
-