Class AbstractSelectStatementGenerator

  • All Implemented Interfaces:
    SelectStatementGenerator
    Direct Known Subclasses:
    DiscriminatorStatementGenerator, UnionStatementGenerator

    public abstract class AbstractSelectStatementGenerator
    extends Object
    implements SelectStatementGenerator
    Abstract generator of SQLStatements. Based around a candidate(s) and optionally including subclasses. If the candidate type has no table of its own (using "subclass-table") and there isn't a single subclass with its own table then throws a NucleusException since there is no root table to select. Accepts options controlling the generation of the SQL.
    • Field Detail

      • clr

        protected final org.datanucleus.ClassLoaderResolver clr
        ClassLoader resolver.
      • parentStmt

        protected SQLStatement parentStmt
        Parent statement.
      • candidateType

        protected Class candidateType
        Candidate type to query.
      • includeSubclasses

        protected final boolean includeSubclasses
        Whether to include iteration through subclasses of the candidate.
      • candidateTable

        protected DatastoreClass candidateTable
        Table where the candidate objects are stored.
      • candidateTableAlias

        protected DatastoreIdentifier candidateTableAlias
        Alias for the candidate table in the SQL statement.
      • candidateTableGroupName

        protected String candidateTableGroupName
        Name of the table-group to use for the candidate(s) (optional, see SQLStatement).
    • Constructor Detail

      • AbstractSelectStatementGenerator

        public AbstractSelectStatementGenerator​(RDBMSStoreManager storeMgr,
                                                org.datanucleus.ClassLoaderResolver clr,
                                                Class candidateType,
                                                boolean subclasses,
                                                DatastoreIdentifier candidateTableAlias,
                                                String candidateTableGroupName)
        Constructor for the case where we select the candidate table.
        Parameters:
        storeMgr - Store Manager
        clr - ClassLoader resolver
        candidateType - Candidate root type
        subclasses - Whether to include subclasses
        candidateTableAlias - Alias for the candidate (optional)
        candidateTableGroupName - Name of the table group for the candidate(s) (optional)
      • AbstractSelectStatementGenerator

        public AbstractSelectStatementGenerator​(RDBMSStoreManager storeMgr,
                                                org.datanucleus.ClassLoaderResolver clr,
                                                Class candidateType,
                                                boolean subclasses,
                                                DatastoreIdentifier candidateTableAlias,
                                                String candidateTableGroupName,
                                                Table joinTable,
                                                DatastoreIdentifier joinTableAlias,
                                                JavaTypeMapping joinElementMapping)
        Constructor for the case where we select the join table and join to the candidate table.
        Parameters:
        storeMgr - Store Manager
        clr - ClassLoader resolver
        candidateType - Candidate root type
        subclasses - Whether to include subclasses
        candidateTableAlias - Alias for the candidate (optional)
        candidateTableGroupName - Name of the table group for the candidate(s) (optional)
        joinTable - Join table
        joinTableAlias - Alias for the join table
        joinElementMapping - Mapping to the candidate from the join table