public class CounterDAO
extends java.lang.Object
Counter objects by JPA queries.| Constructor and Description |
|---|
CounterDAO() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.String issn,
int year,
int month,
javax.persistence.EntityManager em)
checks, whether a specific
Counter object is in the database |
static void |
deleteSingleCounter(java.lang.String issn,
int year,
int month,
javax.persistence.EntityManager em)
deletes a single
Counter object from the database |
static java.util.List<Counter> |
getCounters(java.lang.String onlineISSN)
retrieves a list of
Counter objects for one journal from the database |
static java.util.List<Counter> |
getCountersForYear(java.lang.String issn,
int year,
javax.persistence.EntityManager em)
retrieves a list of
Counter objects for one journal and one year from the database |
static Counter |
getSingleCounter(java.lang.String issn,
int year,
int month,
javax.persistence.EntityManager em)
retrieves a single
Counter object from the database |
static long |
getYearlyTotalRequests(java.lang.String issn,
int year,
javax.persistence.EntityManager em)
returns the sum of all types of request within a given year
|
static void |
persistCounter(Counter counter)
Persists a counter objects to the database
|
static void |
persistCounter(java.util.List<Counter> counters)
persists a list of
Counter objects to the database |
public static void persistCounter(Counter counter)
counter - the counter to be persistedpublic boolean contains(java.lang.String issn,
int year,
int month,
javax.persistence.EntityManager em)
Counter object is in the databaseissn - the ISSN of the journal to be checkedyear - the year of the COUNTER statisticsmonth - the month of the COUNTER statisticsem - the entity manager for the databasepublic static Counter getSingleCounter(java.lang.String issn, int year, int month, javax.persistence.EntityManager em)
Counter object from the databaseissn - the ISSN of the journal to be checkedyear - the year of the COUNTER statisticsmonth - the month of the COUNTER statisticsem - the entity manager for the databasepublic static java.util.List<Counter> getCountersForYear(java.lang.String issn, int year, javax.persistence.EntityManager em)
Counter objects for one journal and one year from the databaseissn - the ISSN of the journal to be checkedyear - the year of the COUNTER statisticsem - the entity manager for the databasepublic static long getYearlyTotalRequests(java.lang.String issn,
int year,
javax.persistence.EntityManager em)
issn - the ISSN of the journal to be checkedyear - the year of the COUNTER statisticsem - the entity manager for the databasepublic static void deleteSingleCounter(java.lang.String issn,
int year,
int month,
javax.persistence.EntityManager em)
Counter object from the databaseissn - the ISSN of the journal to be checkedyear - the year of the COUNTER statisticsmonth - the month of the COUNTER statisticsem - the entity manager for the databasepublic static void persistCounter(java.util.List<Counter> counters)
Counter objects to the databasecounters - the list of COUNTER statistics to be persistedpublic static java.util.List<Counter> getCounters(java.lang.String onlineISSN)
Counter objects for one journal from the databaseonlineISSN - the ISSN of the journal to be checked