Package com.avoka.core.service
Class BaseService
- java.lang.Object
-
- com.avoka.core.service.BaseService
-
- Direct Known Subclasses:
BlankTestReceiptService
,ObjectConverterService
public class BaseService extends Object
Provides base service classes for application services classes to extend
-
-
Field Summary
Fields Modifier and Type Field Description static int
FETCH_LIMIT
The default database fetch limit.
-
Constructor Summary
Constructors Constructor Description BaseService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
commitChanges()
protected void
deleteObject(org.apache.cayenne.DataObject dataObject)
protected void
deleteObjects(Collection dataObjects)
protected org.apache.cayenne.DataObject
findObject(Class dataObjectClass, String property, Object value)
protected org.apache.cayenne.access.DataContext
getDataContext()
protected int
getFetchLimit()
Return the default query fetch limit.protected org.slf4j.Logger
getLogger()
Return the service log.protected Object
getObjectForPK(Class dataObjectClass, Object id)
protected List
performNamedQuery(String queryName, boolean refresh)
protected List
performNamedQuery(String queryName, String[] keys, String[] values, boolean refresh)
protected List
performNamedQuery(String queryName, Map parameters, boolean refresh)
protected int[]
performNonSelectingQuery(String queryName)
protected int[]
performNonSelectingQuery(String queryName, String[] keys, String[] values)
protected int[]
performNonSelectingQuery(String queryName, Map parameters)
protected int[]
performNonSelectingQuery(org.apache.cayenne.query.Query query)
protected List
performQuery(Class dataObjectClass, String property, Object value)
protected List
performQuery(org.apache.cayenne.query.SelectQuery query)
Perform the given select query and set the default fetch limit, if no fetch limit has been set.List
performQueryMatchAll(BaseEntity baseEntity)
Get a list of entities that suits all match criteria.protected void
registerNewObject(org.apache.cayenne.DataObject dataObject)
protected void
rollbackChanges()
protected void
setFetchLimit(int limit)
Set the default query fetch limit.protected Map
toMap(String[] keys, Object[] values)
protected Map
toMap(String key, Object value)
-
-
-
Field Detail
-
FETCH_LIMIT
public static final int FETCH_LIMIT
The default database fetch limit.- See Also:
- Constant Field Values
-
-
Method Detail
-
getFetchLimit
protected int getFetchLimit()
Return the default query fetch limit.- Returns:
- the default query fetch limit
-
setFetchLimit
protected void setFetchLimit(int limit)
Set the default query fetch limit.- Parameters:
limit
- the default query fetch limit
-
getLogger
protected org.slf4j.Logger getLogger()
Return the service log.- Returns:
- the service log
-
getDataContext
protected org.apache.cayenne.access.DataContext getDataContext()
-
registerNewObject
protected void registerNewObject(org.apache.cayenne.DataObject dataObject)
-
deleteObject
protected void deleteObject(org.apache.cayenne.DataObject dataObject)
-
deleteObjects
protected void deleteObjects(Collection dataObjects)
-
commitChanges
protected void commitChanges()
-
rollbackChanges
protected void rollbackChanges()
-
findObject
protected org.apache.cayenne.DataObject findObject(Class dataObjectClass, String property, Object value)
-
performNonSelectingQuery
protected int[] performNonSelectingQuery(org.apache.cayenne.query.Query query)
-
performNonSelectingQuery
protected int[] performNonSelectingQuery(String queryName)
-
performNonSelectingQuery
protected int[] performNonSelectingQuery(String queryName, Map parameters)
-
performQuery
protected List performQuery(org.apache.cayenne.query.SelectQuery query)
Perform the given select query and set the default fetch limit, if no fetch limit has been set.
-
performNamedQuery
protected List performNamedQuery(String queryName, Map parameters, boolean refresh)
-
performNamedQuery
protected List performNamedQuery(String queryName, String[] keys, String[] values, boolean refresh)
-
performNonSelectingQuery
protected int[] performNonSelectingQuery(String queryName, String[] keys, String[] values)
-
performQueryMatchAll
public List performQueryMatchAll(BaseEntity baseEntity)
Get a list of entities that suits all match criteria.- Parameters:
baseEntity
- an entity that has- Returns:
- a list of entities
-
-