Package org.ctan.site.stores
Class LugStore
java.lang.Object
io.dropwizard.hibernate.AbstractDAO<Lug>
org.ctan.site.stores.LugStore
The class
LugStore
contains the repository for LUGs.-
Constructor Summary
ConstructorsConstructorDescriptionLugStore
(org.hibernate.SessionFactory sessionFactory) This is the constructor for theLugStore
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
The methoddrop
provides means to delete a list of lugs.void
The methoddrop
provides means to remove the lug form the database and the search index.findAll()
The methodfindAll
provides means to retrieve all LUGs.The methodfindAllBy
provides means to retrieve LUGs where the short name is starting with a given string.findOrCreateByCode
(String code) The methodfindOrCreateByCode
provides means to retrieve a LUG by its id.The methodgetByKey
provides means to find an lug by its key.The methodsave
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
-
Constructor Details
-
LugStore
public LugStore(org.hibernate.SessionFactory sessionFactory) This is the constructor for theLugStore
.- Parameters:
sessionFactory
- the session factory
-
-
Method Details
-
drop
The methoddrop
provides means to delete a list of lugs.- Parameters:
lugs
- the LUGs to delete
-
drop
The methoddrop
provides means to remove the lug form the database and the search index.- Parameters:
lug
- the lug
-
findAll
The methodfindAll
provides means to retrieve all LUGs.- Returns:
- the list of LUGs
-
findAllBy
The methodfindAllBy
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
The methodfindOrCreateByCode
provides means to retrieve a LUG by its id.- Parameters:
code
- the id code- Returns:
- the LUG or
null
-
getByKey
The methodgetByKey
provides means to find an lug by its key.- Parameters:
key
- the key- Returns:
- the lug or
null
-
save
The methodsave
provides means to persist an lug. As a side effect the search index is updated.- Parameters:
lug
- the lug- Returns:
- the updated lug
-