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 methodgetByAccountprovides means to find an user by its account name.getByEmail(String email) The methodgetByEmailprovides means to find an user by its email.The methodgetprovides means to find an user by its id.The methodlistprovides means to extract a page of items.voidThe methodremoveprovides means to delete an account.booleanremoveByAccount(String account) The methodremoveByAccountprovides means to delete an account by account name.The methodsaveprovides means to store a user in the database.booleanThe methodsetprovides 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 methodgetByAccountprovides means to find an user by its account name.- Parameters:
account- the account name- Returns:
- the user or
null
-
getByEmail
The methodgetByEmailprovides means to find an user by its email.- Parameters:
email- the email- Returns:
- the user or
null
-
getById
The methodgetprovides means to find an user by its id.- Parameters:
id- the is- Returns:
- the user or
null
-
list
The methodlistprovides 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 methodremoveprovides means to delete an account.- Parameters:
user- the account instance
-
removeByAccount
The methodremoveByAccountprovides means to delete an account by account name.- Parameters:
account- the account name- Returns:
trueiff the account has been found
-
save
The methodsaveprovides means to store a user in the database.- Parameters:
user- the user- Returns:
- the user
-
set
The methodsetprovides 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:
trueiff the attribute has been changed
-