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 Details

    • FETCH_LIMIT

      public static final int FETCH_LIMIT
      The default database fetch limit.
      See Also:
  • Constructor Details

    • BaseService

      public BaseService()
  • Method Details

    • 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()
    • getObjectForPK

      protected Object getObjectForPK(Class dataObjectClass, Object id)
    • 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, boolean refresh)
    • performNamedQuery

      protected List performNamedQuery(String queryName, Map parameters, boolean refresh)
    • performNamedQuery

      protected List performNamedQuery(String queryName, String[] keys, String[] values, boolean refresh)
    • performQuery

      protected List performQuery(Class dataObjectClass, String property, Object value)
    • 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
    • toMap

      protected Map toMap(String key, Object value)
    • toMap

      protected Map toMap(String[] keys, Object[] values)