Class LugStore

java.lang.Object
io.dropwizard.hibernate.AbstractDAO<Lug>
org.ctan.site.stores.LugStore

public class LugStore extends io.dropwizard.hibernate.AbstractDAO<Lug>
The class LugStore contains the repository for LUGs.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    void
    drop(List<Lug> lugs)
    The method drop provides means to delete a list of lugs.
    void
    drop(Lug lug)
    The method drop provides means to remove the lug form the database and the search index.
    The method findAll provides means to retrieve all LUGs.
    findAllBy(String pattern)
    The method findAllBy provides means to retrieve LUGs where the short name is starting with a given string.
    The method findOrCreateByCode provides means to retrieve a LUG by its id.
    The method getByKey provides means to find an lug by its key.
    save(Lug lug)
    The method save provides means to persist an lug.

    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

    • LugStore

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

    • drop

      public void drop(List<Lug> lugs)
      The method drop provides means to delete a list of lugs.
      Parameters:
      lugs - the LUGs to delete
    • drop

      public void drop(Lug lug)
      The method drop provides means to remove the lug form the database and the search index.
      Parameters:
      lug - the lug
    • findAll

      public List<Lug> findAll()
      The method findAll provides means to retrieve all LUGs.
      Returns:
      the list of LUGs
    • findAllBy

      public List<Lug> findAllBy(String pattern)
      The method findAllBy provides means to retrieve LUGs where the short name is starting with a given string. The comparison is done case-insensitive.
      Parameters:
      pattern - the pattern for the name
      Returns:
      the list of LUGs ordered by the short name
    • findOrCreateByCode

      public Lug findOrCreateByCode(String code)
      The method findOrCreateByCode provides means to retrieve a LUG by its id.
      Parameters:
      code - the id code
      Returns:
      the LUG or null
    • getByKey

      public Lug getByKey(String key)
      The method getByKey provides means to find an lug by its key.
      Parameters:
      key - the key
      Returns:
      the lug or null
    • save

      public Lug save(Lug lug)
      The method save provides means to persist an lug. As a side effect the search index is updated.
      Parameters:
      lug - the lug
      Returns:
      the updated lug