Class AbstractQuery

java.lang.Object
net.sf.basedb.core.AbstractQuery
All Implemented Interfaces:
Query
Direct Known Subclasses:
AbstractHqlQuery, AbstractSqlQuery

abstract class AbstractQuery extends Object implements Query
An abstract implementation of the Query interface. This class implements all methods and also adds protected methods for generating the main and count queries. Implementors extending this class only needs to add methods for executing the query.
Version:
2.0
Author:
Samuel, Nicklas
Last modified
$Date: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $
  • Field Details

    • logSql

      private static final Logger logSql
      Log all SQL statements.
    • debugEnabled

      private static final boolean debugEnabled
      So we don't always have to call logSql.debug()
    • hasAutoJoined

      private boolean hasAutoJoined
    • autoJoiners

      private Map<Class<?>,AutoJoiner<?,?>> autoJoiners
    • selects

      private List<Select> selects
      List of selections added to the query.
    • permanentSelects

      private List<Select> permanentSelects
      List of permanent selections added to the query.
    • temporarySelects

      private List<Select> temporarySelects
      Tempoarary selections, that are automatically cleared after each build.
    • rootEntity

      private final String rootEntity
      The root enitity.
    • joins

      private List<Join> joins
      List of joins added to the query.
    • permanentJoins

      private List<Join> permanentJoins
      List of permanent joins added to the query.
    • temporaryJoins

      private List<Join> temporaryJoins
      Tempoarary joins, that are automatically cleared after each build.
    • restrictions

      private List<Restriction> restrictions
      List of restrictions added to the query.
    • permanentRestrictions

      private List<Restriction> permanentRestrictions
      List of permanent restrictions added to the query.
    • groups

      private List<Expression> groups
      List of group expressions added to the query.
    • permanentGroups

      private List<Expression> permanentGroups
      List of permanent group expressions added to the query.
    • havings

      private List<Restriction> havings
      List of having restrictions added to the query.
    • permanentHavings

      private List<Restriction> permanentHavings
      List of permanent having restrictions added to the query.
    • orders

      private List<Order> orders
      List of orders added to the query.
    • permanentOrders

      private List<Order> permanentOrders
      List of permanent orders added to the query.
    • parameters

      private Map<String,QueryParameter> parameters
      Parameters values added to the query.
    • firstResult

      private int firstResult
      The index of the first result that should be returned by the query.
    • maxResults

      private int maxResults
      The maximum number of items that should be returned by the query.
    • returnTotalCount

      private boolean returnTotalCount
      If the query should calculate the total number of matching items in the case that limits have been set with firstResult or maxResults.
    • distinct

      private boolean distinct
      If the query should only return the same item once or not.
    • thetaJoinConditions

      private List<String> thetaJoinConditions
      Temporary list to hold theta join conditions if needed by the database.
    • isCounting

      private boolean isCounting
      If the Query.count(DbControl) method is executing or not.
    • querySection

      private QuerySection querySection
      The section of the query that is currently beeing built.
    • failSafe

      private boolean failSafe
      If transactions must be able to continue after an SQL failure or not.
    • HOLDER

      private static final Object HOLDER
  • Constructor Details

    • AbstractQuery

      AbstractQuery(String rootEntity)
      Create a new query.
      Parameters:
      rootEntity - The root entity of the query
  • Method Details