Package org.ctan.site.stores
Class VoteStore
java.lang.Object
io.dropwizard.hibernate.AbstractDAO<Vote>
The class
VoteStore
contains the repository for votes.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The classCountInfo
contains the transport object for the statistics data. -
Constructor Summary
ConstructorsConstructorDescriptionVoteStore
(org.hibernate.SessionFactory sessionFactory) This is the constructor for theVoteStore
. -
Method Summary
Modifier and TypeMethodDescriptionThe methodcount
provides means to retrieve a mean and number of votes for a package by its key.The methodfindByPkg
provides means to retrieve a list of votes for a package.getByAccountAndPkg
(User user, Pkg pkg) The methodgetByAccountAndPkg
provides means to TODO gene.protected jakarta.persistence.criteria.Root
<Vote> listQuery
(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Vote> 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.Methods inherited from class org.ctan.site.stores.base.AbstractStore
getById, list, remove, remove, remove, save
Methods inherited from class io.dropwizard.hibernate.AbstractDAO
criteriaQuery, currentSession, get, getEntityClass, initialize, list, list, namedQuery, namedTypedQuery, persist, query, uniqueResult, uniqueResult
-
Constructor Details
-
VoteStore
public VoteStore(org.hibernate.SessionFactory sessionFactory) This is the constructor for theVoteStore
.- Parameters:
sessionFactory
- the session factory
-
-
Method Details
-
count
The methodcount
provides means to retrieve a mean and number of votes for a package by its key.- Parameters:
key
- the key of the package- Returns:
- the summary
-
findByPkg
The methodfindByPkg
provides means to retrieve a list of votes for a package.- Parameters:
pkg
- the package key- Returns:
- the list of votes ordered by modification time
-
getByAccountAndPkg
The methodgetByAccountAndPkg
provides means to TODO gene.- Parameters:
user
- the userpkg
- the package
-
listQuery
protected jakarta.persistence.criteria.Root<Vote> listQuery(String term, jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.CriteriaQuery<Vote> query) The methodlistQuery
provides means to construct a query for the list of entities for a search.- Specified by:
listQuery
in classAbstractStore<Vote>
- 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<Vote>
- Parameters:
list
- the list of entries- Returns:
- the formatted list
- See Also:
-