Class UserStore

java.lang.Object
io.dropwizard.hibernate.AbstractDAO<User>
org.ctan.site.stores.UserStore

public class UserStore extends io.dropwizard.hibernate.AbstractDAO<User>
The class UserStore contains the repository for users.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UserStore(org.hibernate.SessionFactory sessionFactory)
    This is the constructor for the UserStore.
  • Method Summary

    Modifier and Type
    Method
    Description
    The method getByAccount provides means to find an user by its account name.
    The method getByEmail provides means to find an user by its email.
    The method get provides means to find an user by its id.
    list(String term, int page, int pageSize, String orderBy, boolean asc)
    The method list provides means to extract a page of items.
    void
    remove(User user)
    The method remove provides means to delete an account.
    boolean
    The method removeByAccount provides means to delete an account by account name.
    save(User user)
    The method save provides means to store a user in the database.
    boolean
    set(String account, String key, String value)
    The method set 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UserStore

      public UserStore(org.hibernate.SessionFactory sessionFactory)
      This is the constructor for the UserStore.
      Parameters:
      sessionFactory - the session factory
  • Method Details

    • getByAccount

      public User getByAccount(String account)
      The method getByAccount provides means to find an user by its account name.
      Parameters:
      account - the account name
      Returns:
      the user or null
    • getByEmail

      public User getByEmail(String email)
      The method getByEmail provides means to find an user by its email.
      Parameters:
      email - the email
      Returns:
      the user or null
    • getById

      public User getById(Long id)
      The method get provides means to find an user by its id.
      Parameters:
      id - the is
      Returns:
      the user or null
    • list

      public GeneralPage list(String term, int page, int pageSize, String orderBy, boolean asc)
      The method list provides means to extract a page of items.
      Parameters:
      term - the search term
      page - the current page
      pageSize - the page size
      orderBy - the name or the column to sort by
      asc - the indicator for ascending/descending sort order
      Returns:
      a page with the results
    • remove

      public void remove(User user)
      The method remove provides means to delete an account.
      Parameters:
      user - the account instance
    • removeByAccount

      public boolean removeByAccount(String account)
      The method removeByAccount provides means to delete an account by account name.
      Parameters:
      account - the account name
      Returns:
      true iff the account has been found
    • save

      public User save(User user)
      The method save provides means to store a user in the database.
      Parameters:
      user - the user
      Returns:
      the user
    • set

      public boolean set(String account, String key, String value)
      The method set provides means to alter a single attribute and store the user instance.
      Parameters:
      account - the account
      key - the name of the attribute
      value - the string representation of the value
      Returns:
      true iff the attribute has been changed