Class BaseDao

    • Field Detail

      • FETCH_LIMIT

        public static final int FETCH_LIMIT
        The default database fetch limit.
        See Also:
        Constant Field Values
      • STATEMENT_MAX_NO_PARAMETERS

        public static final int STATEMENT_MAX_NO_PARAMETERS
        The maximum number of parameters that shall be used in a SQL query. Limiting factors: Oracle, which can in theory take up to 64,000 parameters, can handle only up to 1000 values in a single IN clause. SQL server which only up to 2100 query parameters.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BaseDao

        public BaseDao()
    • Method Detail

      • getFetchLimit

        public int getFetchLimit()
        Return the default query fetch limit.
        Returns:
        the default query fetch limit
      • setFetchLimit

        public void setFetchLimit​(int limit)
        Set the default query fetch limit.
        Parameters:
        limit - the default query fetch limit
      • setLocalCacheStrategy

        public void setLocalCacheStrategy​(org.apache.cayenne.query.SelectQuery query)
        Set the application local cache strategy and cache group on the given query.
        Parameters:
        query - apply local cache strategy to the query
      • setLocalCacheStrategy

        public void setLocalCacheStrategy​(org.apache.cayenne.query.SelectQuery query,
                                          String cacheGroup)
        Set the application local cache strategy and cache group on the given query.
        Parameters:
        query - apply local cache strategy to the query
        cacheGroup - the cacheGroup for the query
      • setSharedCacheStrategy

        public void setSharedCacheStrategy​(org.apache.cayenne.query.SelectQuery query,
                                           String cacheGroup)
        Set the application shared cache strategy and cache group on the given query.
        Parameters:
        query - apply shared cache strategy to the query
        cacheGroup - the cacheGroup for the query
      • setCacheStrategy

        public void setCacheStrategy​(org.apache.cayenne.query.SelectQuery query,
                                     org.apache.cayenne.query.QueryCacheStrategy strategy,
                                     String cacheGroup)
        Set the application shared cache strategy and cache group on the given query.
        Parameters:
        query - apply strategy and associate cacheGroup to the query
        strategy - the strategy for the query
        cacheGroup - the cacheGroup for the query
      • 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)
      • newObject

        protected <T> T newObject​(Class<T> persistentClass)
      • deleteObject

        protected void deleteObject​(org.apache.cayenne.DataObject dataObject)
      • deleteObjects

        protected void deleteObjects​(Collection objects)
      • 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.
      • performQuery

        protected List performQuery​(org.apache.cayenne.query.SelectQuery query,
                                    int fetchLimit)
      • performNamedQuery

        protected List performNamedQuery​(String queryName,
                                         boolean refresh)
      • performNamedQuery

        protected List performNamedQuery​(String queryName,
                                         Map parameters)
      • 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)
      • andQueryMatchExp

        protected void andQueryMatchExp​(org.apache.cayenne.query.SelectQuery query,
                                        String property,
                                        Object value)
      • andQueryMatchIsNotNull

        protected void andQueryMatchIsNotNull​(org.apache.cayenne.query.SelectQuery query,
                                              String property)
      • andQueryMatchIsNull

        protected void andQueryMatchIsNull​(org.apache.cayenne.query.SelectQuery query,
                                           String property)
      • andQueryInExp

        protected void andQueryInExp​(org.apache.cayenne.query.SelectQuery query,
                                     String property,
                                     Collection<?> values)
      • andQueryInExp

        protected void andQueryInExp​(org.apache.cayenne.query.SelectQuery query,
                                     String property,
                                     Object[] values)
      • andQueryNoMatchExp

        protected void andQueryNoMatchExp​(org.apache.cayenne.query.SelectQuery query,
                                          String property,
                                          Object value)
      • andQueryMatchDbExp

        protected void andQueryMatchDbExp​(org.apache.cayenne.query.SelectQuery query,
                                          String property,
                                          Object value)
      • andQueryLikeIgnoreCaseExp

        protected void andQueryLikeIgnoreCaseExp​(org.apache.cayenne.query.SelectQuery query,
                                                 String property,
                                                 Object value)
      • andQueryBetween

        protected void andQueryBetween​(org.apache.cayenne.query.SelectQuery query,
                                       String property,
                                       Date startDate,
                                       Date endDate)
      • orQueryMatchExp

        protected void orQueryMatchExp​(org.apache.cayenne.query.SelectQuery query,
                                       String property,
                                       Object value)
      • orQueryLikeIgnoreCaseExp

        protected void orQueryLikeIgnoreCaseExp​(org.apache.cayenne.query.SelectQuery query,
                                                String property,
                                                Object value)
      • andQueryNotTrue

        protected void andQueryNotTrue​(org.apache.cayenne.query.SelectQuery query,
                                       String property)
      • addOrdering

        @Deprecated
        protected void addOrdering​(org.apache.cayenne.query.SelectQuery query,
                                   String property)
        Deprecated.
      • addOrderingCaseSensitive

        protected void addOrderingCaseSensitive​(org.apache.cayenne.query.SelectQuery query,
                                                String property)
      • addOrderingCaseInsensitive

        protected void addOrderingCaseInsensitive​(org.apache.cayenne.query.SelectQuery query,
                                                  String property)