Package org.ctan.site.stores
Class UserStore
java.lang.Object
io.dropwizard.hibernate.AbstractDAO<User>
org.ctan.site.stores.UserStore
The class
UserStore
contains the repository for users.-
Constructor Summary
ConstructorsConstructorDescriptionUserStore
(org.hibernate.SessionFactory sessionFactory) This is the constructor for theUserStore
. -
Method Summary
Modifier and TypeMethodDescriptiongetByAccount
(String account) The methodgetByAccount
provides means to find an user by its account name.getByEmail
(String email) The methodgetByEmail
provides means to find an user by its email.The methodget
provides means to find an user by its id.The methodlist
provides means to extract a page of items.void
The methodremove
provides means to delete an account.boolean
removeByAccount
(String account) The methodremoveByAccount
provides means to delete an account by account name.The methodsave
provides means to store a user in the database.boolean
The methodset
provides means to alter a single attribute and store the user instance.Methods inherited from class io.dropwizard.hibernate.AbstractDAO
criteriaQuery, currentSession, get, getEntityClass, initialize, list, list, namedQuery, namedTypedQuery, persist, query, uniqueResult, uniqueResult
-
Constructor Details
-
UserStore
public UserStore(org.hibernate.SessionFactory sessionFactory) This is the constructor for theUserStore
.- Parameters:
sessionFactory
- the session factory
-
-
Method Details
-
getByAccount
The methodgetByAccount
provides means to find an user by its account name.- Parameters:
account
- the account name- Returns:
- the user or
null
-
getByEmail
The methodgetByEmail
provides means to find an user by its email.- Parameters:
email
- the email- Returns:
- the user or
null
-
getById
The methodget
provides means to find an user by its id.- Parameters:
id
- the is- Returns:
- the user or
null
-
list
The methodlist
provides means to extract a page of items.- Parameters:
term
- the search termpage
- the current pagepageSize
- the page sizeorderBy
- the name or the column to sort byasc
- the indicator for ascending/descending sort order- Returns:
- a page with the results
-
remove
The methodremove
provides means to delete an account.- Parameters:
user
- the account instance
-
removeByAccount
The methodremoveByAccount
provides means to delete an account by account name.- Parameters:
account
- the account name- Returns:
true
iff the account has been found
-
save
The methodsave
provides means to store a user in the database.- Parameters:
user
- the user- Returns:
- the user
-
set
The methodset
provides means to alter a single attribute and store the user instance.- Parameters:
account
- the accountkey
- the name of the attributevalue
- the string representation of the value- Returns:
true
iff the attribute has been changed
-