public class DiscriminatorStatementGenerator extends AbstractSelectStatementGenerator
candidateTable, candidateTableAlias, candidateTableGroupName, candidateType, clr, includeSubclasses, parentStmt, storeMgrOPTION_ALLOW_NULLS, OPTION_INCLUDE_SOFT_DELETES, OPTION_RESTRICT_DISCRIM, OPTION_SELECT_DN_TYPE| Constructor and Description |
|---|
DiscriminatorStatementGenerator(RDBMSStoreManager storeMgr,
org.datanucleus.ClassLoaderResolver clr,
Class[] candidateTypes,
boolean includeSubclasses,
DatastoreIdentifier candidateTableAlias,
String candidateTableGroupName)
Constructor, using the candidateTable as the primary table of the SQL SELECT.
|
DiscriminatorStatementGenerator(RDBMSStoreManager storeMgr,
org.datanucleus.ClassLoaderResolver clr,
Class[] candidateTypes,
boolean includeSubclasses,
DatastoreIdentifier candidateTableAlias,
String candidateTableGroupName,
Table joinTable,
DatastoreIdentifier joinTableAlias,
JavaTypeMapping joinElementMapping)
Constructor, using the joinTable as the primary table of the SQL SELECT and joining to the
table of the candidate(s).
|
DiscriminatorStatementGenerator(RDBMSStoreManager storeMgr,
org.datanucleus.ClassLoaderResolver clr,
Class candidateType,
boolean includeSubclasses,
DatastoreIdentifier candidateTableAlias,
String candidateTableGroupName)
Constructor, using the candidateTable as the primary table of the SQL SELECT.
|
DiscriminatorStatementGenerator(RDBMSStoreManager storeMgr,
org.datanucleus.ClassLoaderResolver clr,
Class candidateType,
boolean includeSubclasses,
DatastoreIdentifier candidateTableAlias,
String candidateTableGroupName,
Table joinTable,
DatastoreIdentifier joinTableAlias,
JavaTypeMapping joinElementMapping)
Constructor, using the joinTable as the primary table of the SQL SELECT and joining to the
table of the candidate.
|
| Modifier and Type | Method and Description |
|---|---|
SelectStatement |
getStatement(org.datanucleus.ExecutionContext ec)
Accessor for the SelectStatement.
|
void |
setParentStatement(SQLStatement stmt)
Method to set the parent statement.
|
hasOption, setOption, unsetOptionpublic DiscriminatorStatementGenerator(RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr, Class candidateType, boolean includeSubclasses, DatastoreIdentifier candidateTableAlias, String candidateTableGroupName)
SELECT
FROM A T0
[WHERE (T0.DISCRIMINATOR = A0value || T0.DISCRIMINATOR = A1value ||
T0.DISCRIMINATOR = A2value || T0.DISCRIMINATOR = A3value ||
T0.DISCRIMINATOR = A4value)]
The "candidateType" will provide the primary table of the SQL SELECT.storeMgr - Manager for the datastoreclr - ClassLoader resolvercandidateType - Base object type that we are looking forincludeSubclasses - Should we include subclasses of this candidate?candidateTableAlias - Alias to use for the candidate table (optional)candidateTableGroupName - Name of the table group for the candidate(s) (optional)public DiscriminatorStatementGenerator(RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr, Class[] candidateTypes, boolean includeSubclasses, DatastoreIdentifier candidateTableAlias, String candidateTableGroupName)
storeMgr - Manager for the datastoreclr - ClassLoader resolvercandidateTypes - Base object type(s) that we are looking forincludeSubclasses - Should we include subclasses of this candidate(s)?candidateTableAlias - Alias to use for the candidate table (optional)candidateTableGroupName - Name of the table group for the candidate(s) (optional)public DiscriminatorStatementGenerator(RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr, Class candidateType, boolean includeSubclasses, DatastoreIdentifier candidateTableAlias, String candidateTableGroupName, Table joinTable, DatastoreIdentifier joinTableAlias, JavaTypeMapping joinElementMapping)
SELECT
FROM A_B T0
INNER JOIN B T1 ON T1.B_ID = A_B.B_ID_EID
[WHERE (T1.DISCRIMINATOR = B0value || T1.DISCRIMINATOR = B1value ||
T1.DISCRIMINATOR = B2value || T1.DISCRIMINATOR = B3value ||
T1.DISCRIMINATOR = B4value)]
The join table will provide the primary table of the SQL SELECT.
The join is INNER JOIN when no nulls are allowed in the collection, and LEFT OUTER JOIN
when it allows nulls.storeMgr - Manager for the datastoreclr - ClassLoader resolvercandidateType - Base object type(s) that we are looking forincludeSubclasses - Should we include subclasses of this candidate?candidateTableAlias - Alias to use for the candidate table (optional)candidateTableGroupName - Name of the table group for the candidate(s) (optional)joinTable - Join table linking owner to elementsjoinTableAlias - any alias to use for the join table in the SQLjoinElementMapping - Mapping in the join table to link to the elementpublic DiscriminatorStatementGenerator(RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr, Class[] candidateTypes, boolean includeSubclasses, DatastoreIdentifier candidateTableAlias, String candidateTableGroupName, Table joinTable, DatastoreIdentifier joinTableAlias, JavaTypeMapping joinElementMapping)
storeMgr - Manager for the datastoreclr - ClassLoader resolvercandidateTypes - Base object type(s) that we are looking forincludeSubclasses - Should we include subclasses of this candidate?candidateTableAlias - Alias to use for the candidate table (optional)candidateTableGroupName - Name of the table group for the candidate(s) (optional)joinTable - Join table linking owner to elementsjoinTableAlias - any alias to use for the join table in the SQLjoinElementMapping - Mapping in the join table to link to the elementpublic void setParentStatement(SQLStatement stmt)
SelectStatementGeneratorstmt - The parent statementpublic SelectStatement getStatement(org.datanucleus.ExecutionContext ec)
ec - ExecutionContextCopyright © 2019. All rights reserved.