|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.store.query.AbstractIteratorStatement
org.jpox.store.query.DiscriminatorIteratorStatement
Class to generate a QueryStatement that can be used for iterating through instances in a single table using a discriminator to distinguish between the classes. There are two modes of operation supported :-
SELECT [THIS.DISCRIMINATOR] FROM A THIS [WHERE (THIS.DISCRIMINATOR = value1 || THIS.DISCRIMINATOR = value2 || THIS_DISCRIMINATOR = value3)]The SELECT of the discriminator column is optional. The WHERE clause is added where we don't want to include all possible classes that are stored in that table. You can omit the WHERE clause by specifying restrictDiscriminator as false.
SELECT [`ELEMENT`.DISCRIMINATOR] FROM SELECTTABLE THIS INNER JOIN B `ELEMENT` ON `ELEMENT`.B_ID = THIS.B_ID_EID [WHERE (`ELEMENT`.DISCRIMINATOR = value1 OR `ELEMENT`.DISCRIMINATOR = value2 || `ELEMENT`.DISCRIMINATOR = value3)]The SELECT of the discriminator column is optional. The WHERE clause is added where we don't want to include all possible classes that are stored in that table. You can omit the WHERE clause by specifying restrictDiscriminator as false.
Field Summary |
Fields inherited from class org.jpox.store.query.AbstractIteratorStatement |
candidateFullClassName, candidateTable, clr, dba, includeSubclasses, LOCALISER, storeMgr |
Constructor Summary | |
DiscriminatorIteratorStatement(ClassLoaderResolver clr,
java.lang.Class[] candidateTypes,
boolean includeSubclasses,
StoreManager storeMgr,
boolean selectDiscriminator)
Constructor, for a candidate type select. |
|
DiscriminatorIteratorStatement(ClassLoaderResolver clr,
java.lang.Class[] candidateType,
boolean includeSubclasses,
StoreManager storeMgr,
boolean selectDiscriminator,
DatastoreContainerObject selectTable,
JavaTypeMapping selectCandidateMapping,
DatastoreIdentifier candidateTableIdentifier)
Constructor, for a candidate type with a select table. |
Method Summary | |
QueryExpression |
getQueryStatement()
Accessor for the Query Statement. |
void |
setRestrictDiscriminator(boolean restrict)
Mutator for whether to restrict the discriminator values in the query to just those of the candidate class (and subclasses where specified). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DiscriminatorIteratorStatement(ClassLoaderResolver clr, java.lang.Class[] candidateTypes, boolean includeSubclasses, StoreManager storeMgr, boolean selectDiscriminator)
clr
- The ClassLoaderResolvercandidateTypes
- Base object types that we are looking forincludeSubclasses
- Should we include subclasses of this candidate?storeMgr
- Manager for the storeselectDiscriminator
- Whether to select the discriminatorpublic DiscriminatorIteratorStatement(ClassLoaderResolver clr, java.lang.Class[] candidateType, boolean includeSubclasses, StoreManager storeMgr, boolean selectDiscriminator, DatastoreContainerObject selectTable, JavaTypeMapping selectCandidateMapping, DatastoreIdentifier candidateTableIdentifier)
clr
- The ClassLoaderResolvercandidateType
- Base object type that we are looking forincludeSubclasses
- Should we include subclasses of this candidate?storeMgr
- Manager for the storeselectDiscriminator
- Whether to select the discriminatorselectTable
- Table to selectselectCandidateMapping
- Mapping in the select table to join with the id of the candidate tablecandidateTableIdentifier
- Identifier to use for the candidate table when using a select tableMethod Detail |
public void setRestrictDiscriminator(boolean restrict)
restrict
- the valid discrim values in the query.public QueryExpression getQueryStatement()
getQueryStatement
in class AbstractIteratorStatement
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |